public static void Initialize(PMPETContext context) { context.Database.EnsureCreated(); //// Look for any students. //if (context.Persons.Any()) //{ // return; // DB has been seeded //} //var persons = new Person[] //{ //new Person{FirstMidName="Carson",LastName="Alexander",JoinDate=DateTime.Parse("2005-09-01"),AddressLine1="17 Birdbrook Road", // AddressLine2 ="Kidbrooke",Town="London",PostCode="SE39QA",MemberType="Buyer"}, //new Person{ FirstMidName = "Ali", LastName = "Kali", JoinDate = DateTime.Parse("2005-09-01"), AddressLine1 = "17 Birdbrook Road", // AddressLine2 = "Kidbrooke", Town = "London", PostCode = "SE39QA", MemberType = "Buyer" } }; //foreach (Person p in persons) //{ // context.Persons.Add(p); //} }
public ViewingsController(PMPETContext context) { _context = context; }
public OffersController(PMPETContext context) { _context = context; }
public RealEstatesController(IHostingEnvironment environment, PMPETContext context) { _environment = environment; _context = context; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, PMPETContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseApplicationInsightsRequestTelemetry(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseApplicationInsightsExceptionTelemetry(); app.UseStaticFiles(); app.UseIdentity(); // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715 app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); DbInitializer.Initialize(context); }
public ServicesController(PMPETContext context) { _context = context; }
public PeopleController(PMPETContext context) { _context = context; }