public async Task <DocumentTypeDto> GetById(Guid id) { if (id == Guid.Empty) { throw new DontExistIdException(); } var searchById = _repoDocumentType .SearchMatchingOneResult <DocumentTypeEntity>(d => d.DocumentTypeId == id); if (searchById == null || searchById == default) { throw new NoExistDocumentTypeException(); } return(await Task.FromResult(_mapper.Map <DocumentTypeDto>(searchById)).ConfigureAwait(false)); }