//---------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner Microsoft
// @backupOwner Microsoft
//---------------------------------------------------------------------
namespace System.Data.EntityModel.SchemaObjectModel
{
using System;
using System.Data.Metadata.Edm;
using System.Xml;
///
/// Represents an CommandText element.
///
internal sealed class FunctionCommandText : SchemaElement
{
private string _commandText;
///
/// Constructs an FunctionCommandText
///
/// Reference to the schema element.
public FunctionCommandText(Function parentElement)
: base(parentElement)
{
}
public string CommandText
{
get { return _commandText; }
}
protected override bool HandleText(XmlReader reader)
{
_commandText = reader.Value;
return true;
}
internal override void Validate()
{
base.Validate();
if (String.IsNullOrEmpty(_commandText))
{
AddError(ErrorCode.EmptyCommandText, EdmSchemaErrorSeverity.Error,
System.Data.Entity.Strings.EmptyCommandText);
}
}
}
}