public async Task Consume(ConsumeContext <GuidUserRequestDto> context) { try { var userGuid = await _operationUsers.GetGuidByNikeNameUserAsync(context.Message.NikeNameUser); await context.RespondAsync(new GuidUserResponseDto { UserGuid = userGuid }); } catch (NoUserFoundException e) { await context.RespondAsync(new NoUserFound { CodeException = e.CodeException, MassageException = $"{e.Message}" }); } catch (Exception e) { await context.RespondAsync(new NoUserFound { MassageException = $"{e.Message}" }); } }
public async Task <IActionResult> GetGuidByNikeNameAuthorAsync(string userNikeName) { try { var result = await _operationUsers.GetGuidByNikeNameUserAsync(userNikeName); return(Ok(result)); } catch (NoUserFoundException exception) { return(Ok(exception)); } }