public void AddIncome(IncomeModel model) { using (var repository = repositoryFactory.Create <Income>()) { repository.Insert(mapper.Map <Income>(model)); } }
public void EditIncome(IncomeModel model) { using (var repository = repositoryFactory.Create <Income>()) { var income = repository.Get(model.Id); repository.Update(mapper.Map(model, income)); } }
public void Put([FromBody] IncomeModel model) { service.EditIncome(model); }
public void Post([FromBody] IncomeModel model) { service.AddIncome(model); }