Пример #1
0
        public IHttpActionResult Post([FromBody] CreateChannelModel command)
        {
            if (command == null || !ModelState.IsValid)
            {
                return(this.Error().InvalidParameters());
            }
            ValidateChannel(command.Name, command.ShortName);
            var channel = _mapper.Map <Channel>(command);

            _channelsRepository.Add(channel);
            return(Ok());
        }
Пример #2
0
 public Channel Add(Channel model)
 {
     _channelsRepository.Add(model);
     return model;
 }