public void UpdateConference(ConferenceModelWithEmail conferenceModel) { Conference conferenceUpdate = _untoldContext.Conference.Find(conferenceModel.ConferenceId); conferenceUpdate.ConferenceName = conferenceModel.ConferenceName; conferenceUpdate.ConferenceCategoryId = conferenceModel.ConferenceCategoryId; conferenceUpdate.ConferenceTypeId = conferenceModel.ConferenceTypeId; conferenceUpdate.MainSpeakerId = conferenceModel.MainSpeakerId; conferenceUpdate.LocationId = conferenceModel.LocationId; conferenceUpdate.StartDate = conferenceModel.StartDate; conferenceUpdate.EndDate = conferenceModel.EndDate; _untoldContext.SaveChanges(); }
public void InsertConference(ConferenceModelWithEmail conferenceModel) { int locationId = 0; int cityId = conferenceModel.LocationId; try { locationId = _untoldContext.Location .Where(l => l.CityId == cityId) .Select(l => l.LocationId).First(); } catch (Exception e) { Location location = new Location() { CityId = cityId }; _untoldContext.Location.Add(location); _untoldContext.SaveChanges(); locationId = _untoldContext.Location.Where(l => l.CityId == cityId).Select(l => l.LocationId).First(); } Conference newConference = new Conference() { ConferenceName = conferenceModel.ConferenceName, ConferenceCategoryId = conferenceModel.ConferenceCategoryId, ConferenceTypeId = conferenceModel.ConferenceTypeId, MainSpeakerId = conferenceModel.MainSpeakerId, LocationId = locationId, StartDate = conferenceModel.StartDate, EndDate = conferenceModel.EndDate, EmailOrganizer = conferenceModel.Email }; _untoldContext.Conference.Add(newConference); _untoldContext.SaveChanges(); }
public IActionResult InsertConference(ConferenceModelWithEmail conferenceModel) { _conferenceRepository.InsertConference(conferenceModel); return(Ok()); }
public IActionResult UpdateConference(ConferenceModelWithEmail conferenceModel) { _conferenceRepository.UpdateConference(conferenceModel); return(Ok()); }
public void UpdateConference(ConferenceModelWithEmail conference) { throw new NotImplementedException(); }