public async Task <IActionResult> Create([Bind("SubDishTypeID,SubType")] SubDishType subDishType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subDishType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(subDishType));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("IngredientTypeID,Name,UnitSingular,UnitPlural")] IngredientType ingredientType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ingredientType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ingredientType));
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("TableID,Capacity")] Table table)
        {
            if (ModelState.IsValid)
            {
                _context.Add(table);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(table));
        }
Example #4
0
 public Task Save()
 {
     return(_context.SaveChangesAsync());
 }