public async Task <IActionResult> PutEndSavingWallet([FromRoute] int id, [FromBody] EndSavingWallet endSavingWallet) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != endSavingWallet.id_end) { return(BadRequest()); } _context.Entry(endSavingWallet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EndSavingWalletExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostEndSavingWallet([FromBody] EndSavingWallet endSavingWallet) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.EndSavingWallet.Add(endSavingWallet); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEndSavingWallet", new { id = endSavingWallet.id_end }, endSavingWallet)); }