EntityContainerEntitySetDefiningQuery.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 / DataEntity / System / Data / EntityModel / SchemaObjectModel / EntityContainerEntitySetDefiningQuery.cs / 1305376 / EntityContainerEntitySetDefiningQuery.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// 
// @owner       [....]
// @backupOwner [....] 
//--------------------------------------------------------------------- 

using System; 
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics; 
using System.Xml;
using System.Data; 
using System.Data.Metadata.Edm; 

namespace System.Data.EntityModel.SchemaObjectModel 
{
    /// 
    /// Represents an DefiningQuery element.
    ///  
    internal sealed class EntityContainerEntitySetDefiningQuery : SchemaElement
    { 
        private string _query; 

        ///  
        /// Constructs an EntityContainerEntitySet
        /// 
        /// Reference to the schema element.
        public EntityContainerEntitySetDefiningQuery(EntityContainerEntitySet parentElement) 
            : base( parentElement )
        { 
        } 

        public string Query 
        {
            get { return _query; }
        }
 
        protected override bool HandleText(XmlReader reader)
        { 
            _query = reader.Value; 
            return true;
        } 

        internal override void Validate()
        {
            base.Validate(); 

            if(String.IsNullOrEmpty(_query)) 
            { 
                AddError(ErrorCode.EmptyDefiningQuery, EdmSchemaErrorSeverity.Error,
                    System.Data.Entity.Strings.EmptyDefiningQuery); 
            }
        }
   }
} 

// 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