コード例 #1
0
 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));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 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();
 }