public async Task <IActionResult> PutTypeOfBread(string id, TypeOfBread typeOfBread) { if (id != typeOfBread.Name) { return(BadRequest()); } _context.Entry(typeOfBread).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeOfBreadExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public SubwaySandwich OrderSandwich(TypeOfSubway subway, TypeOfBread bread, BreadSize size) { var subwayRecipe = CreateSandwich(subway); subwayRecipe.Prepare(subway, bread, size); return(subwayRecipe); }
public override void Prepare(TypeOfSubway subway, TypeOfBread bread, BreadSize size) { RecipeName = "Veggie Delite"; Bread = bread; Size = size; Proteins = subwayRecipe.ChooseProteins(subway); Cheeses = subwayRecipe.AddCheese(subway); Veggies = subwayRecipe.AddVeggies(subway); Sauces = subwayRecipe.AddSauces(subway); }
public override void Prepare(TypeOfSubway subway, TypeOfBread bread, BreadSize size) { RecipeName = "Sweet Onion Chicken Teriyaki"; Bread = bread; Size = size; Proteins = subwayRecipe.ChooseProteins(subway); Cheeses = subwayRecipe.AddCheese(subway); Veggies = subwayRecipe.AddVeggies(subway); Sauces = subwayRecipe.AddSauces(subway); }
public async Task <ActionResult <TypeOfBread> > PostTypeOfBread(TypeOfBread typeOfBread) { _context.TypeOfBread.Add(typeOfBread); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TypeOfBreadExists(typeOfBread.Name)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTypeOfBread", new { id = typeOfBread.Name }, typeOfBread)); }
public abstract void Prepare(TypeOfSubway subway, TypeOfBread bread, BreadSize size);