Example #1
0
        public static void RegisterRepository(IIocManager instance, Assembly assembly, Type typeinterface)
        {
            var repositoryType = assembly.GetTypes().Where(type => type.GetInterfaces().Any(c => c.GUID == typeinterface.GUID) && !type.IsInterface);

            repositoryType.Foreach(type =>
            {
                var attribute = type.GetCustomAttribute <RegisterAliasNameAttribute>();
                string name   = string.Empty;
                if (attribute.IsNotNull())
                {
                    name = attribute.AliasName;
                }
                instance.RegisterRepository(type, typeinterface, name);
            });
        }