Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,PriceS,PriceM,PriceL,Crust")] Pizza pizza)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pizza);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pizza));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Name,RowVersion")] Ingredient ingredient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ingredient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ingredient));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,PizzaName,Price")] OurPizzas ourPizzas)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ourPizzas);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ourPizzas));
        }
Exemplo n.º 4
0
 public void Add(AStore genericType)
 {
     context.Add(mapperStore.Map(genericType));
     context.SaveChanges();
 }