public void InsertOrUpdate(APPOINTMENTSLOT rate) { if (rate.APPOINTMENTSLOTID == default(int)) // New entity { _context.Entry(rate).State = EntityState.Added; } else // Existing entity { _context.Entry(rate).State = EntityState.Modified; } }
public void InsertOrUpdateGraph(APPOINTMENTSLOT userGraph) { if (userGraph.State == DOCVIDEO.ObjectState.State.Added) { _context.APPOINTMENTSLOTS.Add(userGraph); } else { _context.APPOINTMENTSLOTS.Add(userGraph); _context.ApplyStateChanges(); } }