public void DeleteMeetingById(MeetingInfo meeting) { using (var context = new RepoDemo.MeetingDemoEntities()) { context.MeetingDetails.Remove(context.MeetingDetails.Single(x => x.MeetingId == meeting.MeetingId)); context.SaveChanges(); } }
public void SetMeeting(MeetingInfo meeting) { using (var context = new RepoDemo.MeetingDemoEntities()) { var meetingInfo = new MeetingDetail { MeetingAgenda = meeting.MeetingAgenda, MeetingAttendees = meeting.MeetingAttendees, MeetingDateTime = meeting.MeetingDateTime, MeetingSubject = meeting.MeetingSubject }; context.MeetingDetails.Add(meetingInfo); context.SaveChanges(); } }
public void UpdateMeetingById(MeetingInfo meeting) { using (var context = new RepoDemo.MeetingDemoEntities()) { var meetingInfo = new MeetingDetail { MeetingAgenda = meeting.MeetingAgenda, MeetingAttendees = meeting.MeetingAttendees, MeetingDateTime = meeting.MeetingDateTime, MeetingId = meeting.MeetingId, MeetingSubject = meeting.MeetingSubject }; context.Entry(meetingInfo).State = EntityState.Modified; context.SaveChanges(); } }