コード例 #1
0
 public void AddOrUpdate(EmailAlertSubscription subcription)
 {
     if (subcription.Id == 0)
     {
         Add(subcription);
     }
     else
     {
         _context.EmailAlertSubscriptions.Attach(subcription);
         _context.Entry(subcription).State = EntityState.Modified;
         _context.Entry(subcription).Property(x => x.SubscribedByUserId).IsModified  = false;
         _context.Entry(subcription).Property(x => x.SubscribedForUserId).IsModified = false;
     }
 }