Exemple #1
0
        public async Task <IActionResult> Get()
        {
            var query = new GetUserQuery()
            {
                Id = GetCurrentUserId()
            };
            var user = await QueryDispatcher.DispatchQueryAsync <UserDto, GetUserQuery>(query);

            return(Ok(user));
        }
        public async Task <IActionResult> Post([FromBody] ToDoListQuery query)
        {
            var userId = User.Identity.Name;

            query.UserId = new Guid(userId);


            var result = await QueryDispatcher.DispatchQueryAsync <ToDoListResultDto, ToDoListQuery>(query);

            return(Ok(result));
        }
Exemple #3
0
        public async Task <IActionResult> Post([FromBody] SignInQuery query)
        {
            var token = await QueryDispatcher.DispatchQueryAsync <UserSignedInDto, SignInQuery>(query);

            return(Ok(token));
        }