예제 #1
0
 public static T GetService <T>(this Cat cat) => (T)cat.GetService(typeof(T));
예제 #2
0
 public static T GetServices <T>(this Cat cat)
 {
     return(default(T));
 }
예제 #3
0
 public static IEnumerable <T> GetServices <T>(this Cat cat) => cat.GetService <IEnumerable <T> >();
예제 #4
0
 public static Cat CreateChild(this Cat cat) => new Cat(cat);
예제 #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);
 }
예제 #6
0
 public static bool HasRegistry(this Cat cat, Type serviceType) => cat._root._registries.ContainsKey(serviceType);
예제 #7
0
 public static bool HasRegistry <T>(this Cat cat) => cat.HasRegistry(typeof(T));