public async Task Consume(ConsumeContext <GuidAuthorRequestDto> context) { try { var authorGuid = await _operationAuthors.GetGuidByNikeNameAuthorAsync(context.Message.NikeNameAuthor); await context.RespondAsync(new GuidAuthorResponseDto { AuthorGuid = authorGuid }); } catch (NoAuthorFoundException e) { await context.RespondAsync(new NoAuthorFound { CodeException = e.CodeException, MassageException = $"{e.Message}" }); } catch (Exception e) { await context.RespondAsync(new NoAuthorFound { MassageException = $"{e.Message}" }); } }
public async Task <IActionResult> GetGuidByNikeNameAuthorAsync(string authorNikeName) { try { var result = await _operationAuthors.GetGuidByNikeNameAuthorAsync(authorNikeName); return(Ok(result)); } catch (NoAuthorFoundException exception) { return(Ok(exception)); } }