public static void Register <T>( this IDiRegisterOnlyContainer self, LifeStyle?style = null) where T : class => self.RegisterAlias(typeof(T), typeof(T), style);
public static void Register(IDiRegisterOnlyContainer container) { container.RegisterAlias <Philadelphia.Demo.SharedModel.ISomeService, WebClientSomeService>(Philadelphia.Common.LifeStyle.Singleton); container.RegisterAlias <Philadelphia.Demo.SharedModel.ITranslationsService, WebClientTranslationsService>(Philadelphia.Common.LifeStyle.Singleton); }
/// <summary>sadly it is needed for F# as it currently cannot express such generic constraint. /// See https://github.com/fsharp/fslang-suggestions/issues/255 for more info </summary> public static void RegisterAlias <KeyT, ValueT>( this IDiRegisterOnlyContainer self, LifeStyle?style = null) where ValueT : KeyT => self.RegisterAlias(typeof(KeyT), typeof(ValueT), style);
public static void Register(IDiRegisterOnlyContainer container) { container.RegisterAlias <PhiladelphiaPowered.Domain.IHelloWorldService, WebClientHelloWorldService>(Philadelphia.Common.LifeStyle.Singleton); }