Esempio n. 1
0
 public TagsController(IGetTagsCommand getTags,
                       IGetTagCommand getTag,
                       IAddTagCommand addTag, IEditTagCommand editTag, IDeleteTagCommand deleteTag)
 {
     _getTags   = getTags;
     _getTag    = getTag;
     _addTag    = addTag;
     _editTag   = editTag;
     _deleteTag = deleteTag;
 }
 public IActionResult Put(int id, [FromBody] AddTag dto, [FromServices] IEditTagCommand command)
 {
     try
     {
         dto.Id = id;
         executor.ExecuteCommand(command, dto);
         return(StatusCode(204, "Sucess in editing!"));
     }
     catch
     {
         return(StatusCode(422, "Fail!"));
     }
 }