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