public void InsertOrUpdate(PREFERREDDOCTOR spec)
 {
     if (spec.PREFERREDDOCTORID == default(int))  // New entity
     {
         _context.Entry(spec).State = EntityState.Added;
     }
     else        // Existing entity
     {
         _context.Entry(spec).State = EntityState.Modified;
     }
 }
 public void InsertOrUpdateGraph(PREFERREDDOCTOR specGraph)
 {
     if (specGraph.State == DOCVIDEO.ObjectState.State.Added)
     {
         _context.PrefferedDoctors.Add(specGraph);
     }
     else
     {
         _context.PrefferedDoctors.Add(specGraph);
         _context.ApplyStateChanges();
     }
 }