public void UpsertServiceRating(RatingModel input) { try { if (input.Id == 0) { _context.Ratings.Add(input); } else { _context.Entry(input).State = EntityState.Modified; } _context.SaveChanges(); } catch (Exception ex) { throw ex; } }
public void UpsertMessage(MessageModel input) { try { if (input.Id == 0) { _context.Messages.Add(input); } else { _context.Entry(input).State = EntityState.Modified; } _context.SaveChanges(); } catch (Exception ex) { throw ex; } }