public async Task UpdateSurveyByIDAsync(Logic.Objects.Survey targetSurvey) { Data.Entities.Survey contextOldSurvey = await santaContext.Surveys.FirstOrDefaultAsync(s => s.SurveyId == targetSurvey.surveyID); contextOldSurvey.SurveyDescription = targetSurvey.surveyDescription; contextOldSurvey.IsActive = targetSurvey.active; santaContext.Update(contextOldSurvey); }
public async Task UpdateEventByIDAsync(Logic.Objects.Event targetEvent) { Data.Entities.EventType oldContextEvent = await santaContext.EventTypes.FirstOrDefaultAsync(e => e.EventTypeId == targetEvent.eventTypeID); oldContextEvent.EventDescription = targetEvent.eventDescription; oldContextEvent.IsActive = targetEvent.active; santaContext.Update(oldContextEvent); }