/// <summary> /// 更新通道状态 /// </summary> /// <param name="channelUpdateStatus">通道状态</param> /// <returns>更新结果</returns> public IStatusCodeActionResult UpdateStatus(DensityChannelUpdateStatus channelUpdateStatus) { DensityChannel channel = _context.Channels.SingleOrDefault(c => c.ChannelId == channelUpdateStatus.ChannelId); if (channel == null) { return(new NotFoundResult()); } channel.ChannelStatus = channelUpdateStatus.ChannelStatus; _context.Channels.Update(channel); _context.SaveChanges(); return(new OkResult()); }
public IActionResult UpdateStatus([FromBody] DensityChannelUpdateStatus channelUpdateStatus) { return(_manager.UpdateStatus(channelUpdateStatus)); }