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)); }
public Task <ActionResult <UserGetByIdResponse> > GetById([FromServices] IUserQueryService service, [FromRoute] string id ) => service.GetById(id).ToActionResultOfT();