public void SaveChannel(tblChannel Channel) { if (Channel.ChannelId == 0) { db.tblChannels.Add(Channel); } else { db.Entry(Channel).State = EntityState.Modified; } db.SaveChanges(); }
public IActionResult GetChannel(int PKChannel) { try { tblChannel _tblChannel = _ItblChannelRepository.GetSingle(x => x.PKChannel == PKChannel); return(Ok(_tblChannel)); } catch (Exception ex) { log.Fatal("GetChannel:", ex); return(BadRequest(ex.ToString())); } }