Пример #1
0
 public static void RegisterInstance <T>(
     this IDiRegisterOnlyContainer self, T inst, LifeStyle?style = null) where T : class =>
 self.RegisterFactoryMethod(_ => inst, style);
Пример #2
0
 public static void RegisterFactoryMethod <T>(this IDiRegisterOnlyContainer self,
                                              Func <IDiResolveReleaseOnlyContainer, T> factoryMethod, LifeStyle?style = null) =>
 self.RegisterFactoryMethod(typeof(T), container => factoryMethod(container), style);