Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / CommandTrees / DbFunctionCommandTree.cs / 1 / DbFunctionCommandTree.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Data.Metadata.Edm;
using System.Data.Common.CommandTrees.Internal;
namespace System.Data.Common.CommandTrees
{
///
/// Represents a function invocation expressed as a canonical command tree
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")]
public sealed class DbFunctionCommandTree : DbCommandTree
{
private readonly EdmFunction _edmFunction;
private readonly TypeUsage _resultType;
///
/// Constructs a new DbFunctionCommandTree that uses the specified metadata workspace, data space and function metadata
///
/// The metadata workspace that the command tree should use.
/// The logical 'space' that metadata in the expressions used in this command tree must belong to.
///
///
/// , or is null
/// does not represent a valid data space or
/// is a composable function
/*CQT_PUBLIC_API(*/internal/*)*/ DbFunctionCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, EdmFunction edmFunction, TypeUsage resultType)
: base(metadata, dataSpace)
{
using (new EntityBid.ScopeAuto(" %d#", this.ObjectId))
{
EntityUtil.CheckArgumentNull(edmFunction, "edmFunction");
_edmFunction = edmFunction;
_resultType = resultType;
}
}
///
/// Gets the that represents the function to invoke
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")]
public EdmFunction EdmFunction
{
get
{
return _edmFunction;
}
}
///
/// Gets the result type of the function; currently constrained to be a Collection of
/// RowTypes. Unlike typical RowType instance, merely indicates name/type not parameter
/// order.
///
public TypeUsage ResultType
{
get
{
return _resultType;
}
}
internal override DbCommandTreeKind CommandTreeKind
{
get { return DbCommandTreeKind.Function; }
}
internal override void DumpStructure(ExpressionDumper dumper)
{
if (this.EdmFunction != null)
{
dumper.Dump(this.EdmFunction);
}
}
internal override string PrintTree(ExpressionPrinter printer)
{
return printer.Print(this);
}
internal override void Replace(ExpressionReplacer callback)
{
throw EntityUtil.NotSupported();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Data.Metadata.Edm;
using System.Data.Common.CommandTrees.Internal;
namespace System.Data.Common.CommandTrees
{
///
/// Represents a function invocation expressed as a canonical command tree
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")]
public sealed class DbFunctionCommandTree : DbCommandTree
{
private readonly EdmFunction _edmFunction;
private readonly TypeUsage _resultType;
///
/// Constructs a new DbFunctionCommandTree that uses the specified metadata workspace, data space and function metadata
///
/// The metadata workspace that the command tree should use.
/// The logical 'space' that metadata in the expressions used in this command tree must belong to.
///
///
/// , or is null
/// does not represent a valid data space or
/// is a composable function
/*CQT_PUBLIC_API(*/internal/*)*/ DbFunctionCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, EdmFunction edmFunction, TypeUsage resultType)
: base(metadata, dataSpace)
{
using (new EntityBid.ScopeAuto(" %d#", this.ObjectId))
{
EntityUtil.CheckArgumentNull(edmFunction, "edmFunction");
_edmFunction = edmFunction;
_resultType = resultType;
}
}
///
/// Gets the that represents the function to invoke
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")]
public EdmFunction EdmFunction
{
get
{
return _edmFunction;
}
}
///
/// Gets the result type of the function; currently constrained to be a Collection of
/// RowTypes. Unlike typical RowType instance, merely indicates name/type not parameter
/// order.
///
public TypeUsage ResultType
{
get
{
return _resultType;
}
}
internal override DbCommandTreeKind CommandTreeKind
{
get { return DbCommandTreeKind.Function; }
}
internal override void DumpStructure(ExpressionDumper dumper)
{
if (this.EdmFunction != null)
{
dumper.Dump(this.EdmFunction);
}
}
internal override string PrintTree(ExpressionPrinter printer)
{
return printer.Print(this);
}
internal override void Replace(ExpressionReplacer callback)
{
throw EntityUtil.NotSupported();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AllowedAudienceUriElement.cs
- Simplifier.cs
- SpeechRecognitionEngine.cs
- HttpContextWrapper.cs
- SvcMapFile.cs
- TextRenderer.cs
- EncryptedReference.cs
- ProxyElement.cs
- Formatter.cs
- PluggableProtocol.cs
- ProgressBarHighlightConverter.cs
- MdiWindowListItemConverter.cs
- handlecollector.cs
- BlobPersonalizationState.cs
- TextEditorTyping.cs
- DataObjectEventArgs.cs
- SpecularMaterial.cs
- RuleElement.cs
- HtmlSelect.cs
- Delegate.cs
- MetadataException.cs
- BindingValueChangedEventArgs.cs
- FileRegion.cs
- DefaultMemberAttribute.cs
- PointHitTestResult.cs
- BitmapDecoder.cs
- CacheEntry.cs
- xsdvalidator.cs
- ZipFileInfoCollection.cs
- XmlHierarchicalEnumerable.cs
- CompressStream.cs
- NotifyIcon.cs
- PrimitiveSchema.cs
- EmptyEnumerator.cs
- DelegatedStream.cs
- ToolStripLabel.cs
- nulltextcontainer.cs
- DataGridViewCellStyleBuilderDialog.cs
- WmlTextBoxAdapter.cs
- EventSetter.cs
- BasicKeyConstraint.cs
- InvalidCastException.cs
- Range.cs
- WSTrustDec2005.cs
- Models.cs
- FileCodeGroup.cs
- TemplateBindingExpressionConverter.cs
- TypeUnloadedException.cs
- ThemeableAttribute.cs
- MD5.cs
- SettingsProperty.cs
- FontCollection.cs
- LineProperties.cs
- XMLSyntaxException.cs
- IODescriptionAttribute.cs
- DeadCharTextComposition.cs
- ArraySet.cs
- LockCookie.cs
- CreateUserWizardAutoFormat.cs
- FullTextBreakpoint.cs
- SystemIPGlobalStatistics.cs
- RegexWriter.cs
- Parameter.cs
- PrimitiveDataContract.cs
- ChannelServices.cs
- RootDesignerSerializerAttribute.cs
- WorkerRequest.cs
- EntityDataSourceContextDisposingEventArgs.cs
- Int32Animation.cs
- InvalidDataException.cs
- SmtpReplyReader.cs
- DataGridViewRowEventArgs.cs
- VersionedStream.cs
- DataGridTemplateColumn.cs
- IList.cs
- QilStrConcatenator.cs
- CngProperty.cs
- TextPointer.cs
- SerializerProvider.cs
- XamlBuildProvider.cs
- ForwardPositionQuery.cs
- WebHeaderCollection.cs
- HttpEncoder.cs
- X509SecurityTokenProvider.cs
- NameValueFileSectionHandler.cs
- Version.cs
- ValidationError.cs
- ItemCollection.cs
- Renderer.cs
- StubHelpers.cs
- SizeConverter.cs
- SimpleHandlerBuildProvider.cs
- ToolBarTray.cs
- NativeObjectSecurity.cs
- NameSpaceExtractor.cs
- DifferencingCollection.cs
- AttributeUsageAttribute.cs
- FixedStringLookup.cs
- SiteMapNodeItem.cs
- ServerIdentity.cs