Пример #1
0
 // PUT: api/<controller>/5
 public async Task Put(int id, [FromBody] API.Models.Category value)
 {
     if (id > -1 && value != null && !String.IsNullOrEmpty(value.Name))
     {
         await _commandBus.Send(new UserCategoryNameChangeCommand(value.Id, value.Name, value.Version));
     }
     else
     {
         _logger.Error("Category name is not set");
     }
 }
Пример #2
0
 // POST: api/User
 public async Task Post([FromBody] API.Models.Category value)
 {
     if (value != null && !String.IsNullOrEmpty(value.Name))
     {
         await _commandBus.Send(new UserCategoryCreateCommand(value.Name));
     }
     else
     {
         _logger.Error("Category name is not set");
     }
 }
Пример #3
0
 public async Task Delete(int id, [FromBody] API.Models.Category value)
 {
     await _commandBus.Send(new UserCategoryDeleteCommand(id, value.Version));
 }