public Task <HttpResponseMessage> Post([FromBody] dynamic body) { var command = new CreateCategoryVideoCommand( category: (string)body.category ); var category = _service.Create(command); return(CreateResponse(HttpStatusCode.Created, category)); }
public CategoryVideo Create(CreateCategoryVideoCommand command) { var category = new CategoryVideo(command.Category); category.Create(); _repository.Create(category); if (Commit()) { return(category); } return(null); }