public virtual async Task <IActionResult> GetRelationshipsAsync(TId id, string relationshipName)
        {
            _logger.LogTrace($"Entering {nameof(GetRelationshipsAsync)}('{id}', '{relationshipName}').");

            if (_getRelationships == null)
            {
                throw new RequestMethodNotAllowedException(HttpMethod.Get);
            }
            var relationship = await _getRelationships.GetRelationshipsAsync(id, relationshipName);

            return(Ok(relationship));
        }
        public virtual async Task <IActionResult> GetRelationshipsAsync(TId id, string relationshipName)
        {
            if (_getRelationships == null)
            {
                throw Exceptions.UnSupportedRequestMethod;
            }

            var relationship = await _getRelationships.GetRelationshipsAsync(id, relationshipName);

            if (relationship == null)
            {
                return(NotFound());
            }

            return(Ok(relationship));
        }
Пример #3
0
        public virtual async Task <IActionResult> GetRelationshipsAsync(TId id, string relationshipName)
        {
            if (_getRelationships == null)
            {
                throw Exceptions.UnSupportedRequestMethod;
            }
            var relationship = await _getRelationships.GetRelationshipsAsync(id, relationshipName);

            if (relationship == null)
            {
                // remove the null argument as soon as this has been resolved:
                // https://github.com/aspnet/AspNetCore/issues/16969
                return(NotFound(null));
            }

            return(Ok(relationship));
        }