/// <summary> /// Update by overwriting everything /// </summary> /// <param name="newLocation"></param> /// <returns></returns> public static async Task UpdateLocation(Location newLocation) { using (AwesomeContext context = new AwesomeContext()) { context.Locations.Attach(newLocation); context.Entry(newLocation).State = EntityState.Modified; await context.SaveChangesAsync(); } }
/// <summary> /// Update by overwriting everything /// </summary> /// <param name="newParticipant"></param> /// <returns></returns> public static async Task UpdateParticipant(Participant newParticipant) { using (AwesomeContext context = new AwesomeContext()) { context.Participants.Attach(newParticipant); context.Entry(newParticipant).State = EntityState.Modified; await context.SaveChangesAsync(); } }
/// <summary> /// Update by overwriting everything /// </summary> /// <param name="meeting"></param> /// <returns></returns> public static async Task UpdateMeeting(Meeting meeting) { using (AwesomeContext context = new AwesomeContext()) { context.Meetings.Attach(meeting); context.Entry(meeting).State = EntityState.Modified; await context.SaveChangesAsync(); } }