public async Task <SlipModel> UpdateSlip(long id, UpdateSlipModel model) { var slip = await Slips.FindAsync(id); if (slip != null) { var update = new Slip { Id = id }; var result = Slips.Update(update); await SaveChangesAsync(); return(new SlipModel(result.Entity)); } return(null); }
public async Task <ActionResult <IList <SlipModel> > > UpdateSlip([FromHeader] int id, [FromBody] UpdateSlipModel updateModel) { try { return(Ok(await _db.UpdateSlip(id, updateModel))); } catch (Exception) { throw; } }