QueryExpression.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / 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.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK