Ejemplo n.º 1
0
 public static void Register <T>(
     this IDiRegisterOnlyContainer self, LifeStyle?style = null) where T : class =>
 self.RegisterAlias(typeof(T), typeof(T), style);
Ejemplo n.º 2
0
 /// <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);
Ejemplo n.º 3
0
 public static void RegisterInstance <T>(
     this IDiRegisterOnlyContainer self, T inst, LifeStyle?style = null) where T : class =>
 self.RegisterFactoryMethod(_ => inst, style);
Ejemplo n.º 4
0
 public static void RegisterFactoryMethod <T>(this IDiRegisterOnlyContainer self,
                                              Func <IDiResolveReleaseOnlyContainer, T> factoryMethod, LifeStyle?style = null) =>
 self.RegisterFactoryMethod(typeof(T), container => factoryMethod(container), style);
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 public static void Register(IDiRegisterOnlyContainer container)
 {
     container.RegisterAlias <PhiladelphiaPowered.Domain.IHelloWorldService, WebClientHelloWorldService>(Philadelphia.Common.LifeStyle.Singleton);
 }