Example #1
0
        public Task <HttpResponseMessage> Post([FromBody] dynamic body)
        {
            var command = new CreateTimeVideoCommand(
                time: (body.time != null) ? (int)body.time : 0
                );

            var time = _service.Create(command);

            return(CreateResponse(HttpStatusCode.Created, time));
        }
Example #2
0
        public TimeVideo Create(CreateTimeVideoCommand command)
        {
            var time = new TimeVideo(command.Time);

            time.Create();
            _repository.Create(time);

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

            return(null);
        }