public ActionResult Edit(string id, Tax tax) { try { var objectId = ObjectId.Parse(id); var doc = new BsonDocument { { "code", tax.Code }, { "name", tax.Name }, { "percentage", tax.Percentage } }; repository.Update(objectId, doc); return(RedirectToAction("Index")); } catch (Exception ex) { Console.Write(ex.Message); return(null); } }
public async Task Update(Tax tax) { var dto = Mapper.Map <Repositories.Entities.Tax>(tax); await TaxRepository.Update(dto); }