public async Task Consume(ConsumeContext <NikeNameUserRequestDto> context) { try { var userNikeName = await _operationUsers.GetNikeNameByGuidUserAsync(context.Message.UserGuid); await context.RespondAsync(new NikeNameUserResponseDto { NikeNameUser = userNikeName }); } 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> GetNikeNameByGuidUserAsync(Guid userGuid) { try { var result = await _operationUsers.GetNikeNameByGuidUserAsync(userGuid); return(Ok(result)); } catch (NoUserFoundException exception) { return(Ok(exception)); } }