//---------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
{
using System;
using System.Data.Metadata.Edm;
using System.Xml;
///
/// 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);
}
}
}
}