protected override void OnModelCreating(ModelBuilder modelBuilder) { SelectionContainerConfiguration.OnModelCreating(modelBuilder); ContainerConfiguration.OnModelCreating(modelBuilder); CategoryConfiguration.OnModelCreating(modelBuilder); CurrencyTradeConfiguration.OnModelCreating(modelBuilder); }
protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); CategoryConfiguration.ConfigureCategory(modelBuilder); BlogConfiguration.ConfigureBlog(modelBuilder); LikeConfiguration.ConfigureLike(modelBuilder); CommentConfiguration.ConfigureComment(modelBuilder); }
protected override void Seed(ECommerceAppContext context) { TenantConfiguration.Seed(context); CategoryConfiguration.Seed(context); RoleConfiguration.Seed(context); UserConfiguration.Seed(context); ProductConfiguration.Seed(context); }
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(); }
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))); }
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)); }
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); }