Exemple #1
0
        public async Task <ActionResult <CurrentUserResponse> > GetCurrentUser([FromServices] IUserQueryService service,
                                                                               [FromServices] ICurrentUserResolver userResolver)
        {
            var currentId  = userResolver.GetCurrentUserId();
            var userResult = await service.GetById(currentId);

            return(!userResult.IsSuccess
                                ? userResult.To <CurrentUserResponse>().ToActionResultOfT()
                                : new CurrentUserResponse(userResult.Value, currentId));
        }
Exemple #2
0
 public Task <ActionResult <UserGetByIdResponse> > GetById([FromServices] IUserQueryService service,
                                                           [FromRoute] string id
                                                           )
 => service.GetById(id).ToActionResultOfT();