Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
 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;
     }
 }