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