Exemplo n.º 1
0
 public static object ResolveAnonymous(Type type)
 {
     if (_services.ContainsKey(type))
     {
         return(_services[type]);
     }
     throw ServiceLocatorException.ShouldExist(type);
 }
Exemplo n.º 2
0
            public static void Register <TService>(TService service)
            {
                var type = typeof(TService);

                if (_services.ContainsKey(type))
                {
                    throw ServiceLocatorException.ShouldNotExist(type);
                }
                _services[type] = service;
            }