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