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
- XmlRawWriterWrapper.cs
- CommonProperties.cs
- SpotLight.cs
- PlainXmlSerializer.cs
- NavigationPropertyEmitter.cs
- JoinSymbol.cs
- NavigationEventArgs.cs
- StrongNameIdentityPermission.cs
- Int32.cs
- BindUriHelper.cs
- HttpStreamMessageEncoderFactory.cs
- WindowsFormsSectionHandler.cs
- XmlName.cs
- OwnerDrawPropertyBag.cs
- CodeCommentStatement.cs
- TextMarkerSource.cs
- Rect.cs
- SparseMemoryStream.cs
- SQLBoolean.cs
- Clipboard.cs
- NavigationCommands.cs
- CodeTypeReferenceCollection.cs
- SettingsPropertyValue.cs
- ServiceModelSecurityTokenRequirement.cs
- WasHttpHandlersInstallComponent.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- WmpBitmapEncoder.cs
- Brush.cs
- KoreanCalendar.cs
- MSAANativeProvider.cs
- SrgsOneOf.cs
- UrlMappingsSection.cs
- MenuItem.cs
- HorizontalAlignConverter.cs
- Executor.cs
- SimpleHandlerFactory.cs
- HttpCookiesSection.cs
- COM2EnumConverter.cs
- SoapCodeExporter.cs
- RelatedCurrencyManager.cs
- HttpHandlerActionCollection.cs
- ConsoleCancelEventArgs.cs
- Permission.cs
- FunctionDescription.cs
- SchemaLookupTable.cs
- FusionWrap.cs
- HuffCodec.cs
- BindingContext.cs
- DeflateStream.cs
- SimpleHandlerBuildProvider.cs
- BuilderPropertyEntry.cs
- DataRowComparer.cs
- HostedTransportConfigurationBase.cs
- XmlNavigatorFilter.cs
- FixedPosition.cs
- odbcmetadatacollectionnames.cs
- SignatureGenerator.cs
- AssociationTypeEmitter.cs
- QilChoice.cs
- TransactionException.cs
- DoubleLinkListEnumerator.cs
- Pair.cs
- CleanUpVirtualizedItemEventArgs.cs
- SqlOuterApplyReducer.cs
- ElementNotEnabledException.cs
- ReferenceEqualityComparer.cs
- SafeNativeMethodsOther.cs
- QueryOutputWriter.cs
- DivideByZeroException.cs
- RawStylusActions.cs
- FeatureSupport.cs
- WebPartActionVerb.cs
- Int32CAMarshaler.cs
- HtmlButton.cs
- pingexception.cs
- LinkedResourceCollection.cs
- TextBox.cs
- PersistenceTypeAttribute.cs
- DictionaryEntry.cs
- CuspData.cs
- WebPartsPersonalizationAuthorization.cs
- NavigationService.cs
- StylusDevice.cs
- FormsAuthenticationCredentials.cs
- OdbcCommandBuilder.cs
- HtmlInputRadioButton.cs
- SystemException.cs
- Triangle.cs
- ColorBuilder.cs
- MissingMemberException.cs
- HttpContext.cs
- CompiledIdentityConstraint.cs
- _ListenerResponseStream.cs
- Stylesheet.cs
- ProjectedSlot.cs
- DiscardableAttribute.cs
- SiteMapNodeItem.cs
- Vector3dCollection.cs
- MachineKeySection.cs
- InputChannelAcceptor.cs