コード例 #1
0
        public virtual async Task <IActionResult> GetAsync()
        {
            if (_getAll == null)
            {
                throw Exceptions.UnSupportedRequestMethod;
            }
            var entities = await _getAll.GetAsync();

            return(Ok(entities));
        }
コード例 #2
0
        public virtual async Task <IActionResult> GetAsync()
        {
            _logger.LogTrace($"Entering {nameof(GetAsync)}().");

            if (_getAll == null)
            {
                throw new RequestMethodNotAllowedException(HttpMethod.Get);
            }
            var resources = await _getAll.GetAsync();

            return(Ok(resources));
        }
コード例 #3
0
        /// <summary>
        /// Gets a collection of top-level (non-nested) resources.
        /// Example: GET /articles HTTP/1.1
        /// </summary>
        public virtual async Task <IActionResult> GetAsync(CancellationToken cancellationToken)
        {
            _traceWriter.LogMethodStart();

            if (_getAll == null)
            {
                throw new RequestMethodNotAllowedException(HttpMethod.Get);
            }
            var resources = await _getAll.GetAsync(cancellationToken);

            return(Ok(resources));
        }