public void UpdateLocationInfo(Location Entities) { using (var context = new WorkScheduleDBContext()) { var updating = context.Locations.Attach(Entities); var matchingWithExistingValues = context.Entry<Location>(updating); matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void AddLocationInfo (Location Entities) { using (var context = new WorkScheduleDBContext()) { var adding = context.Locations.Add(Entities); context.SaveChanges(); } }