Ejemplo n.º 1
0
        public Result ExecuteAction(List <int> ids)
        {
            var query = _adminUserRepository.AsNoTracking.Where(q => ids.Contains(q.Id));

            var result = new Result().SetSuccess(string.Format(Messages.RecordActivate, query.Count()));

            foreach (var entity in query)
            {
                entity.IsActive = true;
                _adminUserRepository.Update(entity);
            }

            _unitOfWork.Commit();
            AdminUserCacheManager.ClearCache();

            return(result);
        }
Ejemplo n.º 2
0
        public Result ExecuteAction(List <int> ids, int loggedInUserId)
        {
            Validation(ids, loggedInUserId);
            if (!_result.Success)
            {
                return(_result);
            }

            var query = _adminUserRepository.AsNoTracking.Where(q => ids.Contains(q.Id));

            _result = new Result().SetSuccess($"Total {query.Count()} record(s) has been deleted.");

            foreach (var entity in query)
            {
                _adminUserRepository.Delete(entity);
            }

            _unitOfWork.Commit();
            AdminUserCacheManager.ClearCache();

            return(_result);
        }