Exemplo n.º 1
0
        public void AddFollowingUser(string CurrentUserId, string UserId)
        {
            UserFollowingUser _UserFollowingUser = new UserFollowingUser {
                userId = CurrentUserId, followedUserId = UserId
            };

            context.UserFollowingUsers.Add(_UserFollowingUser);
            context.SaveChanges();
        }
Exemplo n.º 2
0
        public void DeleteFollowingUser(string CurrentUserId, string UserId)
        {
            UserFollowingUser _UserFollowingUser = context.UserFollowingUsers.Where(c => c.userId == CurrentUserId && c.followedUserId == UserId).FirstOrDefault();

            if (_UserFollowingUser != null)
            {
                context.UserFollowingUsers.Remove(_UserFollowingUser);
                context.Entry(_UserFollowingUser).State = System.Data.Entity.EntityState.Deleted;
                context.SaveChanges();
            }
        }