Ejemplo n.º 1
0
        public void DeleteRequest(int userId, int groupId)
        {
            GroupEnteringRequest request = dbContext.GroupEnteringRequests
                                           .Where(r => r.SenderId == userId && r.GroupId == groupId).First();

            dbContext.GroupEnteringRequests.Remove(request);
            dbContext.SaveChanges();
        }
Ejemplo n.º 2
0
        public void AcceptRequest(int userId, int groupId)
        {
            GroupEnteringRequest request = dbContext.GroupEnteringRequests
                                           .Where(r => r.SenderId == userId && r.GroupId == groupId).First();

            request.AnswerDate = DateTime.Now;
            dbContext.SaveChanges();
        }
Ejemplo n.º 3
0
        public void AddRequest(int userId, int groupId)
        {
            GroupEnteringRequest request = new GroupEnteringRequest()
            {
                GroupId     = groupId,
                SenderId    = userId,
                SendingDate = DateTime.Now,
                AnswerDate  = DateTime.MinValue
            };

            dbContext.GroupEnteringRequests.Add(request);
            dbContext.SaveChanges();
        }