Exemple #1
0
        public void RemoveBlock(UserBlockVM model)
        {
            var blockRecord = _blockedUserRepository.Get(x => x.UserId == model.UserId && x.BlockedUserId == model.BlockedUserId);

            if (blockRecord != null)
            {
                _blockedUserRepository.Remove(blockRecord);
            }
        }
Exemple #2
0
        public void RemoveBlockedUser(ClaimsPrincipal user, int blockedUserId)
        {
            var thisUser = _userManager.GetUserAsync(user).Result;

            var blockedUser = _blockedUserRepository.Get(x => x.UserId == thisUser.Id && x.BlockedUserId == blockedUserId);

            if (blockedUser != null)
            {
                _blockedUserRepository.Remove(blockedUser);
                _blockedUserRepository.Save();
            }
        }
Exemple #3
0
        // Engel Kaldırma
        public ServiceStatus RemoveBlockedUser(int blockedUserId)
        {
            var serviceStatus = new ServiceStatus();
            var httpUser      = _httpContextAccessor.HttpContext.User;
            var userId        = int.Parse(httpUser.Claims.ToList().Where(x => x.Type == ClaimTypes.NameIdentifier).FirstOrDefault().Value);
            var blockedUser   = _blockedUserRepository.Get(x => x.BlockedUserId == blockedUserId && x.UserId == userId);

            _blockedUserRepository.Remove(blockedUser);
            try
            {
                _blockedUserRepository.SaveChanges();
                serviceStatus.Status = true;
                return(serviceStatus);
            }
            catch (Exception)
            {
                throw;
            }
        }