Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / WebControls / Expressions / QueryExpression.cs / 1305376 / QueryExpression.cs
#if ORYX_VNEXT namespace Microsoft.Web.Data.UI.WebControls.Expressions { #else namespace System.Web.UI.WebControls.Expressions { #endif using System; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Web; using System.Web.UI; [ ParseChildren(true, "Expressions"), PersistChildren(false) ] public class QueryExpression { private HttpContext _context; private Control _owner; private IQueryableDataSource _dataSource; private DataSourceExpressionCollection _expressions; [ PersistenceMode(PersistenceMode.InnerDefaultProperty) ] public DataSourceExpressionCollection Expressions { get { if (_expressions == null) { _expressions = new DataSourceExpressionCollection(); } return _expressions; } } public void Initialize(Control owner, HttpContext context, IQueryableDataSource dataSource) { _owner = owner; _context = context; _dataSource = dataSource; Expressions.SetContext(owner, context, dataSource); } public virtual IQueryable GetQueryable(IQueryable source) { if (source == null) { return null; } foreach (DataSourceExpression e in Expressions) { source = e.GetQueryable(source) ?? source; } return source; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. #if ORYX_VNEXT namespace Microsoft.Web.Data.UI.WebControls.Expressions { #else namespace System.Web.UI.WebControls.Expressions { #endif using System; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Web; using System.Web.UI; [ ParseChildren(true, "Expressions"), PersistChildren(false) ] public class QueryExpression { private HttpContext _context; private Control _owner; private IQueryableDataSource _dataSource; private DataSourceExpressionCollection _expressions; [ PersistenceMode(PersistenceMode.InnerDefaultProperty) ] public DataSourceExpressionCollection Expressions { get { if (_expressions == null) { _expressions = new DataSourceExpressionCollection(); } return _expressions; } } public void Initialize(Control owner, HttpContext context, IQueryableDataSource dataSource) { _owner = owner; _context = context; _dataSource = dataSource; Expressions.SetContext(owner, context, dataSource); } public virtual IQueryable GetQueryable(IQueryable source) { if (source == null) { return null; } foreach (DataSourceExpression e in Expressions) { source = e.GetQueryable(source) ?? source; } return source; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StatusBarDrawItemEvent.cs
- LogWriteRestartAreaAsyncResult.cs
- Collection.cs
- FormDocumentDesigner.cs
- FormViewInsertedEventArgs.cs
- InputLanguageCollection.cs
- DependencyPropertyKind.cs
- RSAOAEPKeyExchangeFormatter.cs
- WorkflowMarkupSerializationException.cs
- FixedSOMImage.cs
- VideoDrawing.cs
- CompilerParameters.cs
- WebScriptClientGenerator.cs
- ProtocolViolationException.cs
- Size3D.cs
- ResourceProperty.cs
- ConfigurationManagerHelper.cs
- SettingsBindableAttribute.cs
- IsolatedStorageFileStream.cs
- ShapeTypeface.cs
- UnicodeEncoding.cs
- SQLDateTimeStorage.cs
- XsdBuildProvider.cs
- MasterPageParser.cs
- QueryResponse.cs
- LassoSelectionBehavior.cs
- UrlMappingsModule.cs
- CounterNameConverter.cs
- TypeElementCollection.cs
- IndentedWriter.cs
- SQLGuid.cs
- PartialCachingControl.cs
- ObjRef.cs
- SchemaConstraints.cs
- HtmlHistory.cs
- _NegotiateClient.cs
- CodeSnippetTypeMember.cs
- System.Data_BID.cs
- StorageComplexPropertyMapping.cs
- DiscoveryDocument.cs
- PackageStore.cs
- ShapingWorkspace.cs
- HttpVersion.cs
- CroppedBitmap.cs
- ServiceContractGenerator.cs
- FormsAuthentication.cs
- ListViewItem.cs
- ProjectionPathBuilder.cs
- InterleavedZipPartStream.cs
- ChannelDispatcherBase.cs
- DatasetMethodGenerator.cs
- DataControlFieldHeaderCell.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- RemoteWebConfigurationHostServer.cs
- Tokenizer.cs
- WebBaseEventKeyComparer.cs
- ContextMenuAutomationPeer.cs
- ListBoxItem.cs
- PathSegment.cs
- ThreadStaticAttribute.cs
- XomlCompilerHelpers.cs
- DeferredElementTreeState.cs
- querybuilder.cs
- HwndHostAutomationPeer.cs
- InternalRelationshipCollection.cs
- PipelineModuleStepContainer.cs
- AsymmetricSignatureFormatter.cs
- Encoder.cs
- ImageAutomationPeer.cs
- EmbeddedObject.cs
- SoapInteropTypes.cs
- Rule.cs
- Blend.cs
- IdentifierService.cs
- TableParaClient.cs
- TextView.cs
- CollectionBase.cs
- WindowsToolbar.cs
- DataGridViewRowHeaderCell.cs
- AnnotationMap.cs
- BuildProviderAppliesToAttribute.cs
- NativeRecognizer.cs
- BrushConverter.cs
- StorageScalarPropertyMapping.cs
- EllipseGeometry.cs
- BridgeDataReader.cs
- SecureEnvironment.cs
- DataTableMappingCollection.cs
- UserControlCodeDomTreeGenerator.cs
- HostingEnvironmentSection.cs
- PromptEventArgs.cs
- AssemblyName.cs
- MediaPlayer.cs
- DesignSurfaceServiceContainer.cs
- GraphicsContainer.cs
- DataObjectMethodAttribute.cs
- ComboBoxItem.cs
- Relationship.cs
- TypeListConverter.cs
- SQLConvert.cs