Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }