Skip to content

Instantly share code, notes, and snippets.

Created May 7, 2019 09:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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