Beispiel #1
0
        private void RegisterGenericRepositories()
        {
            var dbContextTypes =
                _typeFinder.GetAllTypes(type =>
                                        type.IsPublic &&
                                        !type.IsAbstract &&
                                        type.IsClass &&
                                        typeof(DbContext).IsAssignableFrom(type)
                                        );

            if (dbContextTypes.IsNullOrEmpty())
            {
                return;
            }

            foreach (var dbContextType in dbContextTypes)
            {
                EfRepositoryRegistrar.RegisterForDbContext(dbContextType, IocManager);
            }
        }
Beispiel #2
0
 public void TypeFinder()
 {
     var types1 = _typeFinder.GetAllTypes();
 }
Beispiel #3
0
 /// <summary>
 /// 查找所有组件。
 /// </summary>
 /// <returns>返回组件列表。</returns>
 public List <Type> FindAll()
 {
     return(_typeFinder.GetAllTypes(ComponentBase.IsComponent).ToList());
 }