Пример #1
0
 public void AddIncome(IncomeModel model)
 {
     using (var repository = repositoryFactory.Create <Income>())
     {
         repository.Insert(mapper.Map <Income>(model));
     }
 }
Пример #2
0
 public void EditIncome(IncomeModel model)
 {
     using (var repository = repositoryFactory.Create <Income>())
     {
         var income = repository.Get(model.Id);
         repository.Update(mapper.Map(model, income));
     }
 }
Пример #3
0
 public void Put([FromBody] IncomeModel model)
 {
     service.EditIncome(model);
 }
Пример #4
0
 public void Post([FromBody] IncomeModel model)
 {
     service.AddIncome(model);
 }