private static Dictionary <T, T2> CacheServices <T, T2>() where T2 : UploaderService <T> { T2[] instances = Helpers.GetInstances <T2>(); AllServices.AddRange(instances.Cast <IUploaderService>()); return(instances.ToDictionary(x => x.EnumValue, x => x)); }
private static Dictionary <T, T2> CacheServices <T, T2>() where T2 : UploaderService <T> { IEnumerable <T2> instances = Helpers.GetInstances <T2>(); AllServices.AddRange(instances.OfType <IUploaderService>()); AllGenericUploaderServices.AddRange(instances.OfType <IGenericUploaderService>()); return(instances.ToDictionary(x => x.EnumValue, x => x)); }