private static object GetSingleton(Type service) { try { return(Singletons.FirstOrDefault(x => x.Key == service).Value); } catch { } return(null); }
private static Service GetSingleton <Service>() { try { return((Service)Singletons.FirstOrDefault(x => x.Key == typeof(Service)).Value); } catch { } return(default(Service)); }