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()); }
public Channel Add(Channel model) { _channelsRepository.Add(model); return model; }