- add generic factory

master
Simon G. 23 hours ago
parent f3d17117fc
commit 7d3a12fabf
Signed by: SimonG
GPG Key ID: 0B82B964BA536523
  1. 1
      Debug.LightweightIocContainer.FactoryGenerator/SampleInstaller.cs
  2. 12
      Debug.LightweightIocContainer.FactoryGenerator/Samples/Factories/IGenericSampleFactory.cs
  3. 7
      Debug.LightweightIocContainer.FactoryGenerator/Samples/Interfaces/IOtherSample.cs
  4. 9
      Debug.LightweightIocContainer.FactoryGenerator/Samples/OtherSample.cs

@ -16,5 +16,6 @@ public class SampleInstaller : IIocInstaller
public void Install(IRegistrationCollector registration)
{
registration.Add<ISampleClass, SampleClass>().WithGeneratedFactory<ISampleClassFactory>();
registration.Add<IOtherSample, OtherSample>().WithGeneratedFactory<IGenericSampleFactory<IOtherSample>>();
}
}

@ -0,0 +1,12 @@
// Author: Simon.Gockner
// Created: 2025-12-05
// Copyright(c) 2025 SimonG. All Rights Reserved.
using Debug.LightweightIocContainer.FactoryGenerator.Samples.Interfaces;
namespace Debug.LightweightIocContainer.FactoryGenerator.Samples.Factories;
public interface IGenericSampleFactory<T> where T : IOtherSample
{
T Create();
}

@ -0,0 +1,7 @@
// Author: Simon.Gockner
// Created: 2025-12-05
// Copyright(c) 2025 SimonG. All Rights Reserved.
namespace Debug.LightweightIocContainer.FactoryGenerator.Samples.Interfaces;
public interface IOtherSample;

@ -0,0 +1,9 @@
// Author: Simon.Gockner
// Created: 2025-12-05
// Copyright(c) 2025 SimonG. All Rights Reserved.
using Debug.LightweightIocContainer.FactoryGenerator.Samples.Interfaces;
namespace Debug.LightweightIocContainer.FactoryGenerator.Samples;
public class OtherSample : IOtherSample;
Loading…
Cancel
Save