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
- TypeNameConverter.cs
- SystemKeyConverter.cs
- DataGridRowsPresenter.cs
- SimpleType.cs
- WsatRegistrationHeader.cs
- ProfessionalColorTable.cs
- Attribute.cs
- WindowsRichEditRange.cs
- IdentityNotMappedException.cs
- Positioning.cs
- UnknownWrapper.cs
- SpeechRecognizer.cs
- NativeMethods.cs
- CollectionBase.cs
- TagElement.cs
- HandlerWithFactory.cs
- HtmlControlPersistable.cs
- DataObject.cs
- RoleGroupCollection.cs
- SqlUserDefinedTypeAttribute.cs
- ExplicitDiscriminatorMap.cs
- XsdCachingReader.cs
- Point3D.cs
- MemberAssignmentAnalysis.cs
- XmlSchemaAttribute.cs
- NullPackagingPolicy.cs
- ControlPropertyNameConverter.cs
- TargetParameterCountException.cs
- smtpconnection.cs
- Span.cs
- CombinedTcpChannel.cs
- ConsoleTraceListener.cs
- CrossSiteScriptingValidation.cs
- panel.cs
- SqlCommandAsyncResult.cs
- XmlSchemaObject.cs
- XD.cs
- PerfService.cs
- HashHelpers.cs
- HwndHostAutomationPeer.cs
- PropertyItemInternal.cs
- RemotingAttributes.cs
- StringUtil.cs
- UpdatePanelTriggerCollection.cs
- Stack.cs
- Mappings.cs
- SelectedDatesCollection.cs
- UncommonField.cs
- DbQueryCommandTree.cs
- Axis.cs
- NotConverter.cs
- HttpFileCollectionWrapper.cs
- ContentPathSegment.cs
- DNS.cs
- PersistenceException.cs
- PrintingPermissionAttribute.cs
- EventManager.cs
- DbLambda.cs
- InputDevice.cs
- DrawingGroup.cs
- PointIndependentAnimationStorage.cs
- DashStyle.cs
- AuthenticationService.cs
- RijndaelManaged.cs
- codemethodreferenceexpression.cs
- CharacterHit.cs
- MLangCodePageEncoding.cs
- wgx_sdk_version.cs
- EndpointNotFoundException.cs
- DataControlFieldCell.cs
- IdentityNotMappedException.cs
- HttpApplication.cs
- Imaging.cs
- OleDbRowUpdatingEvent.cs
- ChannelPoolSettings.cs
- EditorAttributeInfo.cs
- KeyNotFoundException.cs
- OracleRowUpdatedEventArgs.cs
- WindowsSidIdentity.cs
- TextTreeTextBlock.cs
- OneOf.cs
- DataGridViewRowCollection.cs
- RelatedImageListAttribute.cs
- AnnotationResourceChangedEventArgs.cs
- WebPartEditVerb.cs
- webeventbuffer.cs
- ResourceReferenceExpression.cs
- TimeSpan.cs
- XmlQueryTypeFactory.cs
- StrongTypingException.cs
- WindowsListViewScroll.cs
- ConfigurationProperty.cs
- SafeCoTaskMem.cs
- TrustManagerPromptUI.cs
- PeerUnsafeNativeCryptMethods.cs
- _SafeNetHandles.cs
- ToolBarOverflowPanel.cs
- TypeSystem.cs
- MimeParameterWriter.cs
- TileBrush.cs