This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public RestResultBase Get(ContentReference id, string query, ContentReference referenceId, ContentReference[] references, string[] typeIdentifiers, bool? allLanguages, IEnumerable<SortColumn> sortColumns, ItemRange range) | |
{ | |
ContentQueryParameters parameters1 = new ContentQueryParameters(); | |
parameters1.ReferenceId = referenceId; | |
parameters1.References = references; | |
parameters1.AllLanguages = allLanguages.Value; | |
parameters1.TypeIdentifiers = typeIdentifiers; | |
parameters1.SortColumns = sortColumns; | |
parameters1.Range = range; | |
parameters1.AllParameters = base.ControllerContext.HttpContext.Request.QueryString; | |
parameters1.CurrentPrincipal = PrincipalInfo.CurrentPrincipal; | |
parameters1.PreferredCulture = allLanguages.Value ? null : this._languageResolver.GetPreferredCulture(); | |
ContentQueryParameters queryParameters = parameters1; | |
if (string.IsNullOrEmpty(query) && ContentReference.IsNullOrEmpty(id)) | |
{ | |
return base.Rest(new object[0]); | |
} | |
if (string.IsNullOrEmpty(query)) | |
{ | |
return this.GetContent(id, queryParameters); | |
} | |
QueryRange<IContent> range2 = this.GetQuery(query, queryParameters).ExecuteQuery(queryParameters); | |
if ((range2 == null) || (range2.Items == null)) | |
{ | |
return new RestStatusCodeResult((HttpStatusCode) HttpStatusCode.NotFound); | |
} | |
IEnumerable<StructureStoreContentDataModel> data = this.CreateStoreModels((IEnumerable<IContent>) range2.Items, queryParameters); | |
RestResult result1 = base.Rest(data); | |
result1.Range = range2.Range; | |
return result1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment