Esempio n. 1
0
 public static T GetService <T>(this Cat cat) => (T)cat.GetService(typeof(T));
Esempio n. 2
0
 public static T GetServices <T>(this Cat cat)
 {
     return(default(T));
 }
Esempio n. 3
0
 public static IEnumerable <T> GetServices <T>(this Cat cat) => cat.GetService <IEnumerable <T> >();
Esempio n. 4
0
 public static Cat CreateChild(this Cat cat) => new Cat(cat);
Esempio n. 5
0
 public static Cat Register <TServiceType>(this Cat cat, Func <Cat, TServiceType> factory, Lifetime lifetime)
 {
     cat.Register(new ServiceRegistry(typeof(TServiceType), lifetime, (_, arguments) => factory(_)));
     return(cat);
 }
Esempio n. 6
0
 public static bool HasRegistry(this Cat cat, Type serviceType) => cat._root._registries.ContainsKey(serviceType);
Esempio n. 7
0
 public static bool HasRegistry <T>(this Cat cat) => cat.HasRegistry(typeof(T));