Beispiel #1
0
        public async Task <DeleteMemberQueryResult> DeleteMemberQueryHandler(DeleteMemberCommand command)
        {
            var result = await _memberRepository.DeleteRecordAsync(command.Id);

            if (result == 1)
            {
                return(new DeleteMemberQueryResult()
                {
                    IsSuccess = true
                });
            }
            return(new DeleteMemberQueryResult()
            {
                IsSuccess = false
            });
        }
Beispiel #2
0
        public async Task <DeleteMemberCommandResult> DeleteMemberCommandHandler(Guid command)
        {
            var isSucceed = true;

            var affectedRecordsCount = await _memberRepository.DeleteRecordAsync(command);

            if (affectedRecordsCount < 1)
            {
                isSucceed = false;
            }

            return(new DeleteMemberCommandResult()
            {
                Succeed = isSucceed
            });
        }