public Meeting CreateMeeting(Meeting meetingModel) { _context.Entry(meetingModel.creator).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(meetingModel).State = System.Data.Entity.EntityState.Added; _context.SaveChanges(); return(_context.Meetings.SingleOrDefault(x => x.Title == meetingModel.Title)); }
public async Task <Event> CreateEvent(Event eventModel) { _context.Entry(eventModel.User).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(eventModel).State = System.Data.Entity.EntityState.Added; var result = await _context.SaveChangesAsync(); return(eventModel); }
public void createMeetingRequest(MeetingRequest meetingRequest) { _context.Entry(meetingRequest.User).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(meetingRequest.Meeting).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(meetingRequest).State = System.Data.Entity.EntityState.Added; var result = _context.SaveChanges(); }
public async Task <Connection> AcceptConnection(Connection connection) { connection.Status = Status.Accepted; connection.StartDate = DateTime.Now; _context.Entry(connection.User1).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(connection.User2).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(connection).State = System.Data.Entity.EntityState.Modified; var result = await _context.SaveChangesAsync(); return(connection); }
public void readConnestionNotification(ConnectionNotification notification) { _context.Entry(notification.User1).State = System.Data.Entity.EntityState.Unchanged; _context.Entry(notification).State = System.Data.Entity.EntityState.Modified; var result = _context.SaveChanges(); }