public async Task <ApoliceAutomovel> Update(ApoliceAutomovel apoliceAutomovel) { _context.Entry(apoliceAutomovel).State = EntityState.Modified; await _context.SaveChangesAsync(); return(apoliceAutomovel); }
public async Task <ApoliceAutomovel> Add(ApoliceAutomovel apoliceAutomovel) { _context.ApoliceAutomovel.Add(apoliceAutomovel); await _context.SaveChangesAsync(); return(apoliceAutomovel); }
public async Task <IActionResult> PutApoliceAutomovel(int id, ApoliceAutomovel apoliceAutomovel) { if (id != apoliceAutomovel.Id) { return(BadRequest()); } try { await _apoliceAutomovelService.Update(apoliceAutomovel); } catch (DbUpdateConcurrencyException) { return(NotFound()); } return(NoContent()); }
public async Task <ActionResult <ApoliceAutomovel> > PostApoliceAutomovel(ApoliceAutomovel apoliceAutomovel) { await _apoliceAutomovelService.Add(apoliceAutomovel); return(CreatedAtAction("GetApoliceAutomovel", new { id = apoliceAutomovel.Id }, apoliceAutomovel)); }
public async Task <ApoliceAutomovel> Update(ApoliceAutomovel apoliceAutomovel) { return(await _apoliceAutomovelRepository.Update(apoliceAutomovel)); }
public async Task <ApoliceAutomovel> Add(ApoliceAutomovel apoliceAutomovel) { return(await _apoliceAutomovelRepository.Add(apoliceAutomovel)); }