Пример #1
0
        public async Task <IResult> Delete(params OperationClaim[] operationClaims)
        {
            var roles     = _operationClaimDal.GetAll(x => x.UserOperationClaims);
            var deletable = roles.Where(x => operationClaims.Any(y => y.Id == x.Id) && x.UserOperationClaims.Count == 0).ToList();

            _operationClaimDal.DeleteRange(deletable.ToArray());

            if (await _operationClaimDal.SaveChangesAsync() > 0)
            {
                return(new SuccessResult());
            }

            return(new ErrorResult());
        }