Пример #1
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            // modelBuilder.AddEntityConfigurationsFromAssembly(GetType().Assembly);
            //var assemblyName = ConfigManager.GetValue<string>("SqlConfig:EntityConfigurationAssembly");
            //modelBuilder.AddEntityConfigurationsFromAssembly(AssemblyHelper.GetAssembly(assemblyName));

            var assemblies        = AssemblyHelper.GetAssemblyList(Assembly.GetExecutingAssembly().Location);
            var currentAssemblies = AssemblyHelper.CreateModulesByFilter(assemblies, ConstantHelper.REPOSITORY);

            modelBuilder.AddEntityConfigurationsFromAssembly(currentAssemblies[0]);
        }