ProjectionPlan.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 / DataWeb / Client / System / Data / Services / Client / ProjectionPlan.cs / 1305376 / ProjectionPlan.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//  
// Provides a class that encapsulates how to materialize an ATOM
// entry using a projection. 
//  
//---------------------------------------------------------------------
 
namespace System.Data.Services.Client
{
    #region Namespaces.
 
    using System;
    using System.Diagnostics; 
 
    #endregion Namespaces.
 
    /// Use this class to store a materialization plan used with projections.
    internal class ProjectionPlan
    {
#if DEBUG 
        /// Source projection for this plan.
        internal System.Linq.Expressions.Expression SourceProjection 
        { 
            get;
            set; 
        }

        /// Target projection for this plan.
        internal System.Linq.Expressions.Expression TargetProjection 
        {
            get; 
            set; 
        }
#endif 

        /// Last segment type for query.
        /// This typically matches the expected element type at runtime.
        internal Type LastSegmentType 
        {
            get; 
            set; 
        }
 
        /// Provides a method to materialize a payload.
        internal Func Plan
        {
            get; 
            set;
        } 
 
        /// Expected type to project.
        internal Type ProjectedType 
        {
            get;
            set;
        } 

#if DEBUG 
        /// Returns a string representation for this object. 
        /// A string representation for this object, suitable for debugging.
        public override string ToString() 
        {
            return "Plan - projection: " + this.SourceProjection + "\r\nBecomes: " + this.TargetProjection;
        }
#endif 

        /// Runs this plan. 
        /// Materializer under which materialization should happen. 
        /// Root entry to materialize.
        /// Expected type for the . 
        /// The materialized object.
        internal object Run(AtomMaterializer materializer, AtomEntry entry, Type expectedType)
        {
            Debug.Assert(materializer != null, "materializer != null"); 
            Debug.Assert(entry != null, "entry != null");
 
            return this.Plan(materializer, entry, expectedType); 
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.


                        

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