Пример #1
0
        public async Task <Friend> ConfirmedRequestReceive(int friendId)
        {
            var    user        = miiContext.Friends.Find(friendId);
            string user1       = user.User1;
            string user2       = user.User2;
            var    receiveUser = miiContext.Friends.Include(r => r.User1).FirstOrDefault(r => r.User1 == user1 && r.Receive == true && r.User2 == user2);

            receiveUser.Receive   = false;
            receiveUser.Sent      = false;
            receiveUser.Confirmed = true;
            miiContext.Friends.Update(receiveUser);
            miiContext.SaveChanges();
            var result = await ConfirmedRequestSent(user1, user2);

            return(result);
        }
 Comment ICommentRepository.Add(Comment Comment)
 {
     context.Comments.Add(Comment);
     context.SaveChanges();
     return(Comment);
 }
Пример #3
0
 Post IPostRepository.Add(Post Post)
 {
     context.Posts.Add(Post);
     context.SaveChanges();
     return(Post);
 }