예제 #1
0
        public async Task <ActionResult <ChannelDTO> > Update(Guid channelId, [FromBody] UpdateChannelDTO model)
        {
            // Get the selected channel
            var channel = channelRepository.GetById(channelId);

            // Update the channel model with the information received from our DTO.
            channel.UpdateFromUpdateChannelDTO(model);
            // Save changes made to the channel model.
            channelRepository.SaveChanges();
            return(NoContent());
        }
예제 #2
0
 public void UpdateFromUpdateChannelDTO(UpdateChannelDTO model)
 {
     this.Name = model.Name;
     // Automatically update the modified time to reflect changes.
     this.Modified = DateTime.Now;
 }