Exemple #1
0
 public bool Delete(AdminUserDto entity)
 {
     try
     {
         return(rep.Delete(entity.MapTo <AdminUser>()));
     }
     catch (Exception)
     {
         throw;
     }
 }
        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);
        }