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));
        }
Пример #2
0
        public CategoryVideo Create(CreateCategoryVideoCommand command)
        {
            var category = new CategoryVideo(command.Category);

            category.Create();
            _repository.Create(category);

            if (Commit())
            {
                return(category);
            }

            return(null);
        }