public async Task <Barbeque> UpdateAsync(int id, AddBarbequeModel updatedBbq) { Barbeque bbq = new Barbeque(updatedBbq.Description, updatedBbq.EventDateTime); bbq.Id = id; return(await _barbequeRepository.Update(bbq)); }
public async Task <Barbeque> Update(Barbeque barbeque) { _context.Barbeques.Update(barbeque); await _context.SaveChangesAsync(true); return(barbeque); }
public async Task <bool> Remove(Barbeque barbeque) { _context.Barbeques.Remove(barbeque); await _context.SaveChangesAsync(true); return(true); }
public async Task <Barbeque> AddAsync(Barbeque barbeque) { await _context.Barbeques.AddAsync(barbeque); await _context.SaveChangesAsync(true); return(barbeque); }
public void Run() { margueritta pizza = new margueritta(); freshtomato freshtomato = new freshtomato(pizza); chickenfiesta pizza2 = new chickenfiesta(); Barbeque barbeque = new Barbeque(pizza2); Console.WriteLine("Preços:"); Console.WriteLine("Pizza: {0}, {1} R$. Adicional: {2}, {3} R$.", pizza.nome, pizza.GetCost(), freshtomato.nome, freshtomato.GetfreshtomatoCost()); Console.WriteLine("Pizza: {0}, {1} R$. Adicional: {2}, {3} R$.", pizza2.nome, pizza2.GetCost(), barbeque.nome, barbeque.GetBarbequeCost()); Console.WriteLine("Pedidos:"); Console.WriteLine("Pizza: {0} com adicional: {1}. Preço total: {2} R$.", pizza.nome, freshtomato.nome, freshtomato.GetCost()); Console.WriteLine("Pizza: {0} com adicional: {1}. Preço total: {2} R$.", pizza2.nome, barbeque.nome, barbeque.GetCost()); }
public async Task <bool> DeleteAsync(int id) { Barbeque bbq = await _barbequeRepository.FindByIdAsync(id); return(await _barbequeRepository.Remove(bbq)); }
public async Task <Barbeque> AddAsync(AddBarbequeModel insertedBbq) { Barbeque bbq = new Barbeque(insertedBbq.Description, insertedBbq.EventDateTime); return(await _barbequeRepository.AddAsync(bbq)); }