public Task <TResult> GetAsync <TResult>(string path, object moduleRequest) where TResult : class { var result = path switch { "/identity/me" => moduleRequest switch { MeQuery q => new UserDto(q.UserId, _userIdToNickname.ContainsKey(q.UserId) ? _userIdToNickname[q.UserId] : _defaultNickname, FakeAvatar), _ => throw new ArgumentException($"There is no handler under given request[{moduleRequest.GetType().Name}]") },
public async Task <ActionResult <UserDto> > Me() { var query = new MeQuery(User); return(await _mediator.Send(query)); }