示例#1
0
        public async Task <StatusCodes> DeleteItemAsync(string id, string requestId = "")
        {
            _logger.LogInformation($"RequestId: {requestId} - MetaData_DeleteItemAsync called.");
            Guard.Against.NullOrEmpty(id, nameof(id), requestId);

            try
            {
                var result = await _metaDataRepository.DeleteItemAsync(id, requestId);

                Guard.Against.NotStatus204NoContent(result, $"MetaData_DeleteItemAsync failed for id: {id}", requestId);

                return(result);
            }
            catch (Exception ex)
            {
                _logger.LogError($"RequestId: {requestId} - MetaData_DeleteItemAsync Service Exception: {ex}");
                throw new ResponseException($"RequestId: {requestId} - MetaData_DeleteItemAsync Service Exception: {ex}");
            }
        }