コード例 #1
0
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     SelectionContainerConfiguration.OnModelCreating(modelBuilder);
     ContainerConfiguration.OnModelCreating(modelBuilder);
     CategoryConfiguration.OnModelCreating(modelBuilder);
     CurrencyTradeConfiguration.OnModelCreating(modelBuilder);
 }
コード例 #2
0
ファイル: AppDbContext.cs プロジェクト: Alaaddin30/Project
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     base.OnModelCreating(modelBuilder);
     CategoryConfiguration.ConfigureCategory(modelBuilder);
     BlogConfiguration.ConfigureBlog(modelBuilder);
     LikeConfiguration.ConfigureLike(modelBuilder);
     CommentConfiguration.ConfigureComment(modelBuilder);
 }
コード例 #3
0
 protected override void Seed(ECommerceAppContext context)
 {
     TenantConfiguration.Seed(context);
     CategoryConfiguration.Seed(context);
     RoleConfiguration.Seed(context);
     UserConfiguration.Seed(context);
     ProductConfiguration.Seed(context);
 }
コード例 #4
0
        public static void AddMongoDbContext(this IServiceCollection service, string server, string database, int?port = null)
        {
            service.AddSingleton <MongoSettings>(new MongoSettings
            {
                ServerUrl = server,
                Database  = database,
                Port      = port
            });
            service.AddScoped <DataContext>();

            CategoryConfiguration.Configure();
        }
コード例 #5
0
        public CategoryViewModel(ILog log, RootViewModel root, CategoryConfiguration categoryConfiguration)
        {
            _log = log;

            RootVM = root;

            Name.Value           = categoryConfiguration.Name;
            IsNodeExpanded.Value = categoryConfiguration.IsExpanded;
            HasPendingMigrations = new Binding <bool>();

            DeleteCategoryCommand = new RelayCommand(async param => await DeleteCategory());
            FullUpdateAllUnderlyingProjectsCommand    = new RelayCommand(async param => await FullUpdateAllUnderlyingProjectsAsync());
            RefreshAllUnderlyingProjectsCommand       = new RelayCommand(async param => await RefreshAllUnderlyingProjectsAsync());
            LoadUnderlyingProjectsOnStartCommand      = new RelayCommand(param => SetLoadUnderlyingProjectsOnStart(true));
            DoNotLoadUnderlyingProjectsOnStartCommand = new RelayCommand(param => SetLoadUnderlyingProjectsOnStart(false));

            categoryConfiguration.Categories.ForEach(c => Add(new CategoryViewModel(_log, RootVM, c)));
            categoryConfiguration.Projects.ForEach(p => Add(new ProjectViewModel(_log, RootVM, p)));
        }
コード例 #6
0
    public IActionResult SeedData()
    {
        var lst = new List <string>();

        if (!_dbContext.Categories.Any())
        {
            var count = new CategoryConfiguration().Seed(_dbContext);
            lst.Add($"{count} Categories have been seeded.");
        }
        if (!_dbContext.Products.Any())
        {
            var count = new ProductConfiguration().Seed(_dbContext);
            lst.Add($"{count} Products have been seeded.");
        }
        if (lst.Count == 0)
        {
            lst.Add("Nothing has been seeded.");
        }
        return(Json(lst));
    }
コード例 #7
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.HasDefaultSchema("efcore");

            CategoryConfiguration.Configure(modelBuilder.Entity <Category>());
            ShipperConfiguration.Configure(modelBuilder.Entity <Shipper>());
            RegionConfiguration.Configure(modelBuilder.Entity <Region>());
            SupplierConfiguration.Configure(modelBuilder.Entity <Supplier>());
            EmployeeConfiguration.Configure(modelBuilder.Entity <Employee>());
            CustomerDemographicsConfiguration.Configure(modelBuilder.Entity <CustomerDemoGraphic>());
            CustomerConfiguration.Configure(modelBuilder.Entity <Customer>());
            OrderConfiguration.Configure(modelBuilder.Entity <Order>());
            ProductConfiguration.Configure(modelBuilder.Entity <Product>());
            TerritoryConfiguration.Configure(modelBuilder.Entity <Territories>());
            EmployeeTerritoryConfiguration.Configure(modelBuilder.Entity <EmployeeTerritories>());
            CustomerCustomerDemographConfiguration.Configure(modelBuilder.Entity <CustomerCustomerDemograph>());
            OrderDetailConfiguration.Configure(modelBuilder.Entity <OrderDetail>());

            base.OnModelCreating(modelBuilder);
        }