private static void MigrateDatabase(IWebHost host) { using (IServiceScope scope = host.Services.CreateScope()) { OdeToFoodDbContext db = scope.ServiceProvider.GetRequiredService <OdeToFoodDbContext>(); db.Database.Migrate(); } }
public DbInitializer( OdeToFoodDbContext context, RoleManager <IdentityRole> roleManager) { _context = context; _roleManager = roleManager; }
public RestaurantService(OdeToFoodDbContext odeToFoodRepo) { this._restaurantsData = odeToFoodRepo; // new List<Restaurant>() //{ // new Restaurant { Id=1, Name="Mr. Pizza"}, // new Restaurant { Id=2, Name="Domino's" }, // new Restaurant { Id=3, Name="The Restaurant" } //}; }
public TestController(OdeToFoodDbContext context) { _context = context; }
public SqlRestaurantRepository(OdeToFoodDbContext context) { this.context = context; }
public CreateModel(OdeToFoodDbContext context, IHtmlHelper htmlHelper) { _context = context; _htmlHelper = htmlHelper; }
public SqlRestuarantData(OdeToFoodDbContext context) { this._context = context; }
public HomeController() { OdeToFoodDbContext dbx = new OdeToFoodDbContext(); db = new SqlRestaurantData(dbx); }
public RestaurantsController(OdeToFoodDbContext context) { _context = context; }
public SqlRestaurantData(OdeToFoodDbContext dbContext) { _dbContext = dbContext; }
public RestaurantRepository(OdeToFoodDbContext dbContext) { _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); }
public SqlInventory(OdeToFoodDbContext context) { _context = context; }
public RestaurantsController(OdeToFoodDbContext db) { _db = db; }
public SqlContactData(OdeToFoodDbContext context) { _context = context; }
public SqlRestaurantData(OdeToFoodDbContext context) { // need to use in other methods so set private field _context = context; }
public SqlResaurantData(OdeToFoodDbContext context) { _context = context; }
public SqlRestaurantData(OdeToFoodDbContext ctx) { _ctx = ctx; }
public RestaurantRepository(OdeToFoodDbContext context) => _context = context;
public SqlRestaurantData(OdeToFoodDbContext odeToFoodDbContext) { _odeToFoodDbContext = odeToFoodDbContext; }
public VarorModelsController(OdeToFoodDbContext context) { _context = context; }
public SqlRestaurantData(OdeToFoodDbContext context) { _context = context; }
public SqlRestaurantData(OdeToFoodDbContext db) { this.db = db; }