示例#1
0
        public IResult Delete(int id)
        {
            var result = _operationClaimDal.Get(o => o.Id == id);

            _operationClaimDal.Delete(result);
            return(new SuccessResult(Messages.DeletedSuccess));
        }
示例#2
0
            public async Task <IResult> Handle(DeleteOperationClaimCommand request, CancellationToken cancellationToken)
            {
                var claimToDelete = await _operationClaimDal.GetAsync(x => x.Id == request.Id);

                _operationClaimDal.Delete(claimToDelete);
                await _operationClaimDal.SaveChangesAsync();

                return(new SuccessResult(Messages.OperationClaimDeleted));
            }
        public IResult Delete(OperationClaim operationClaim)
        {
            IResult result = BusinessRules.Run();

            if (result != null)
            {
                return(result);
            }

            _operationClaimDal.Delete(operationClaim);
            return(new SuccessResult());
        }
        public IResult Delete(string name)
        {
            var     deleteToOperationClaim = _operationClaimDal.Get(op => op.Name == name);
            IResult result = BusinessRule.Run
                             (
                CheckIfClaimAlreadyDeleted(deleteToOperationClaim.Name)
                             );

            if (result != null)
            {
                return(result);
            }

            _operationClaimDal.Delete(deleteToOperationClaim);
            return(new SuccessResult(OperationClaimMessages.Deleted));
        }
        public IResult Delete(OperationClaim operationClaim)
        {
            _operationClaimDal.Delete(operationClaim);

            return(new SuccessResult(Messages.OperationClaimDeleted));
        }
 public IResult Delete(OperationClaim entity)
 {
     _userDal.Delete(entity);
     return(new SuccessResult(Messages.Deleted));
 }