Beispiel #1
0
        public static void Initialize(ArchitectDbContext context)
        {
            context.Database.EnsureCreated();

            // Look for any movies
            if (context.Customers.Any())
            {
                return;
            }

            context.Customers.AddRange(
                new Customer {
                FirstName = "Kurt", LastName = "Van de gaer"
            },
                new Customer {
                FirstName = "Erik", LastName = "Kaes"
            },
                new Customer {
                FirstName = "Philippe", LastName = "Kenens"
            },
                new Customer {
                FirstName = "Petra", LastName = "Luyten"
            }
                );

            context.SaveChanges();
        }
Beispiel #2
0
        public static void Seed(ArchitectDbContext dbContext)
        {
            dbContext.Add(new User()
            {
                FirstName = "Name", LastName = "Surname", Username = "******", Password = "******"
            });
            dbContext.Add(new Record()
            {
                Description = "Record 1"
            });

            dbContext.SaveChanges();
        }
Beispiel #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ArchitectDbContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            DbInitializer.Initialize(context);
        }
Beispiel #4
0
 public CustomersController(ArchitectDbContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public RepositoryUnit(ArchitectDbContext dbContext) => DbContext = dbContext;
 public RecordRepository(ArchitectDbContext dbContext) : base(dbContext)
 {
 }
Beispiel #7
0
 protected Repository(ArchitectDbContext dbContext) => DbContext = dbContext;
Beispiel #8
0
 public UserRepository(ArchitectDbContext dbContext) : base(dbContext)
 {
 }