Пример #1
0
        public async Task <IActionResult> List(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "Tweet")] HttpRequest req,
            [AccessToken] AccessTokenResult accessToken = default)
        {
            _logger.LogInformation("Starting {operation}", nameof(List));

            if (accessToken?.Status != AccessTokenStatus.Valid)
            {
                return(new UnauthorizedResult());
            }

            var documents = await _repository.List();

            return(new OkObjectResult(documents));
        }