[HttpPut("{id}")] // api/ledger{id} public ActionResult UpdateLedger(int id, LedgerUpdateModel ledgerUpdateModel) { var ledgerModelFromRepo = _repository.ReadLedgerById(id); if (ledgerModelFromRepo == null) { return(NotFound()); } _mapper.Map(ledgerUpdateModel, ledgerModelFromRepo); _repository.UpdateLedger(ledgerModelFromRepo); return(NoContent()); }
public IHttpActionResult UpdateLedger(LedgerModel model) { var data = ledgerRepo.UpdateLedger(model); return(Ok(data)); }