Example #1
0
 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;
 }
Example #5
0
 public SqlRestaurantRepository(OdeToFoodDbContext context)
 {
     this.context = context;
 }
 public CreateModel(OdeToFoodDbContext context, IHtmlHelper htmlHelper)
 {
     _context    = context;
     _htmlHelper = htmlHelper;
 }
Example #7
0
 public SqlRestuarantData(OdeToFoodDbContext context)
 {
     this._context = context;
 }
Example #8
0
        public HomeController()
        {
            OdeToFoodDbContext dbx = new OdeToFoodDbContext();

            db = new SqlRestaurantData(dbx);
        }
 public RestaurantsController(OdeToFoodDbContext context)
 {
     _context = context;
 }
Example #10
0
 public SqlRestaurantData(OdeToFoodDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #11
0
 public RestaurantRepository(OdeToFoodDbContext dbContext)
 {
     _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
 }
Example #12
0
 public SqlInventory(OdeToFoodDbContext context)
 {
     _context = context;
 }
Example #13
0
 public RestaurantsController(OdeToFoodDbContext db)
 {
     _db = db;
 }
 public SqlContactData(OdeToFoodDbContext context)
 {
     _context = context;
 }
Example #15
0
 public SqlRestaurantData(OdeToFoodDbContext context)
 {
     // need to use in other methods so set private field
     _context = context;
 }
 public SqlResaurantData(OdeToFoodDbContext context)
 {
     _context = context;
 }
Example #17
0
 public SqlRestaurantData(OdeToFoodDbContext ctx)
 {
     _ctx = ctx;
 }
Example #18
0
 public RestaurantRepository(OdeToFoodDbContext context) => _context = context;
Example #19
0
 public SqlRestaurantData(OdeToFoodDbContext odeToFoodDbContext)
 {
     _odeToFoodDbContext = odeToFoodDbContext;
 }
Example #20
0
 public VarorModelsController(OdeToFoodDbContext context)
 {
     _context = context;
 }
Example #21
0
 public SqlRestaurantData(OdeToFoodDbContext context)
 {
     _context = context;
 }
 public SqlRestaurantData(OdeToFoodDbContext db)
 {
     this.db = db;
 }