public async Task <IActionResult> Handle(DeleteTestCommand request, CancellationToken cancellationToken)
        {
            var _response = new Response();

            try
            {
                var result = await _test.DeleteTestAsync(request);

                if (result.ResultType == ApiResultType.Success)
                {
                    _response.Status  = true;
                    _response.Message = result.MessageText;
                }
                else
                {
                    _response.Status  = false;
                    _response.Message = result.MessageText;
                }
                return(_response.ToHttpResponse());
            }
            catch (Exception ex)
            {
                ErrorTrace.Logger(LogArea.ProviderLayer, ex);
                _response.Status  = false;
                _response.Message = "Exception";
                return(_response.ToHttpResponse());
            }
        }
Пример #2
0
 public async Task <bool> DeleteTestAsync(int id)
 {
     return(await _testRepository.DeleteTestAsync(id));
 }