private void GenerateQueryResult() { if (this.description.CountOption == RequestQueryCountOption.ValueOnly) { this.description.VerifyProtocolVersion(RequestDescription.Version2Dot0, this.service); this.description.VerifyRequestVersion(RequestDescription.Version2Dot0, this.service); this.description.VerifyAndRaiseResponseVersion(RequestDescription.Version2Dot0, this.service); this.queryExpression = this.queryExpression.QueryableLongCount(); } else if (this.rootProjectionNode != null) { IExpandProvider service = this.service.Provider.GetService <IExpandProvider>(); if (service != null) { if (this.IsStandardPaged) { throw new DataServiceException(500, System.Data.Services.Strings.DataService_SDP_TopLevelPagedResultWithOldExpandProvider); } if (this.rootProjectionNode.ProjectionsSpecified) { throw new DataServiceException(500, System.Data.Services.Strings.DataService_Projections_ProjectionsWithOldExpandProvider); } if (this.rootProjectionNode.ExpansionOnDerivedTypesSpecified) { throw new DataServiceException(500, System.Data.Services.Strings.DataService_DerivedExpansions_OldExpandProvider); } this.ProcessOrderBy(); this.ProcessSkipAndTop(); this.queryExpression = Expression.Call(Expression.Constant(service), ApplyExpansionsMethodInfo, this.queryExpression, Expression.Constant(this.rootProjectionNode.ExpandPaths)); this.rootProjectionNode.UseExpandPathsForSerialization = true; } else { IProjectionProvider projectionProvider = this.service.Provider.ProjectionProvider; if (projectionProvider == null) { projectionProvider = new BasicExpandProvider(this.service.Provider, false, true); } this.queryExpression = Expression.Call(null, DataServiceExecutionProviderMethods.ApplyProjectionsMethodInfo, Expression.Constant(projectionProvider, typeof(object)), this.queryExpression, Expression.Constant(this.rootProjectionNode, typeof(object))); } } else if (!string.IsNullOrEmpty(this.service.OperationContext.Host.GetQueryStringItem("$expand"))) { this.ProjectSkipTokenForNonExpand(); this.ProcessOrderBy(); this.ProcessSkipAndTop(); } }
// Create the IUpdatable Interface public override void Setup() { base.Setup(); expander = nhib as IExpandProvider; }