- add method to add generated factory

pull/62/head
Simon G. 5 days ago
parent 230a030b04
commit 543018a560
Signed by: SimonG
GPG Key ID: 0B82B964BA536523
  1. 8
      LightweightIocContainer/Registrations/RegistrationBase.cs

@ -120,6 +120,14 @@ internal abstract class RegistrationBase : IRegistrationBase, IWithFactoryIntern
return this; return this;
} }
internal void AddGeneratedFactory<TFactory>(TFactory generatedFactory)
{
TypedFactory<TFactory> factory = new(generatedFactory);
Factory = factory;
_container.RegisterFactory(factory);
}
/// <summary> /// <summary>
/// Register a custom implemented factory for the <see cref="IRegistrationBase"/> /// Register a custom implemented factory for the <see cref="IRegistrationBase"/>

Loading…
Cancel
Save