コード例 #1
0
        public async Task <ActionResult <PlayerDto> > GetPlayer([FromRoute] Guid playerId)
        {
            var query = new GetPlayerQuery()
            {
                PlayerId = playerId
            };
            var result = await _queryDispatcher.QueryAsync <PlayerDto>(query);

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
コード例 #2
0
 public Task <CreatureReadModel> Get(GetPlayerQuery query, CancellationToken cancellationToken)
 {
     return(_mediator.Send(query ?? new GetPlayerQuery(), cancellationToken));
 }