Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / CommandTrees / DbFunctionCommandTree.cs / 1305376 / DbFunctionCommandTree.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Metadata.Edm; using System.Data.Common.CommandTrees.Internal; using System.Linq; 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; private readonly System.Collections.ObjectModel.ReadOnlyCollection_parameterNames; private readonly System.Collections.ObjectModel.ReadOnlyCollection _parameterTypes; /// /// 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 /*CQT_PUBLIC_API(*/internal/*)*/ DbFunctionCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, EdmFunction edmFunction, TypeUsage resultType, IEnumerable does not represent a valid data space or /// is a composable function > parameters) : base(metadata, dataSpace) { using (new EntityBid.ScopeAuto(" %d#", this.ObjectId)) { EntityUtil.CheckArgumentNull(edmFunction, "edmFunction"); _edmFunction = edmFunction; _resultType = resultType; List paramNames = new List (); List paramTypes = new List (); if (parameters != null) { foreach (KeyValuePair paramInfo in parameters) { paramNames.Add(paramInfo.Key); paramTypes.Add(paramInfo.Value); } } _parameterNames = paramNames.AsReadOnly(); _parameterTypes = paramTypes.AsReadOnly(); } } /// /// Gets the [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")] public EdmFunction EdmFunction { get { return _edmFunction; } } ///that represents the function to invoke /// /// 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 IEnumerable> GetParameters() { for (int idx = 0; idx < this._parameterNames.Count; idx++) { yield return new KeyValuePair (this._parameterNames[idx], this._parameterTypes[idx]); } } internal override void DumpStructure(ExpressionDumper dumper) { if (this.EdmFunction != null) { dumper.Dump(this.EdmFunction); } } internal override string PrintTree(ExpressionPrinter printer) { return printer.Print(this); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Metadata.Edm; using System.Data.Common.CommandTrees.Internal; using System.Linq; 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; private readonly System.Collections.ObjectModel.ReadOnlyCollection_parameterNames; private readonly System.Collections.ObjectModel.ReadOnlyCollection _parameterTypes; /// /// 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 /*CQT_PUBLIC_API(*/internal/*)*/ DbFunctionCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, EdmFunction edmFunction, TypeUsage resultType, IEnumerable does not represent a valid data space or /// is a composable function > parameters) : base(metadata, dataSpace) { using (new EntityBid.ScopeAuto(" %d#", this.ObjectId)) { EntityUtil.CheckArgumentNull(edmFunction, "edmFunction"); _edmFunction = edmFunction; _resultType = resultType; List paramNames = new List (); List paramTypes = new List (); if (parameters != null) { foreach (KeyValuePair paramInfo in parameters) { paramNames.Add(paramInfo.Key); paramTypes.Add(paramInfo.Value); } } _parameterNames = paramNames.AsReadOnly(); _parameterTypes = paramTypes.AsReadOnly(); } } /// /// Gets the [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")] public EdmFunction EdmFunction { get { return _edmFunction; } } ///that represents the function to invoke /// /// 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 IEnumerable> GetParameters() { for (int idx = 0; idx < this._parameterNames.Count; idx++) { yield return new KeyValuePair (this._parameterNames[idx], this._parameterTypes[idx]); } } internal override void DumpStructure(ExpressionDumper dumper) { if (this.EdmFunction != null) { dumper.Dump(this.EdmFunction); } } internal override string PrintTree(ExpressionPrinter printer) { return printer.Print(this); } } } // 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
- PathNode.cs
- DynamicFilterExpression.cs
- EncoderBestFitFallback.cs
- CodeArgumentReferenceExpression.cs
- ObjectCloneHelper.cs
- Rotation3D.cs
- CompositionAdorner.cs
- XmlSignatureProperties.cs
- RouteTable.cs
- ToolboxItemCollection.cs
- FileDialog.cs
- CommentEmitter.cs
- PagesSection.cs
- ModulesEntry.cs
- ExpandSegment.cs
- DataTablePropertyDescriptor.cs
- RadioButtonAutomationPeer.cs
- Journaling.cs
- MDIWindowDialog.cs
- ToolStripSeparator.cs
- Image.cs
- RoutedCommand.cs
- RepeaterItemCollection.cs
- XmlSchemaComplexContentRestriction.cs
- CorrelationQuery.cs
- MenuItemStyle.cs
- loginstatus.cs
- UserControlAutomationPeer.cs
- UnsafeNativeMethodsMilCoreApi.cs
- RadioButton.cs
- XmlParserContext.cs
- AdjustableArrowCap.cs
- TableRowCollection.cs
- SafeCertificateStore.cs
- PersonalizationStateInfoCollection.cs
- IntersectQueryOperator.cs
- AttachmentCollection.cs
- WebRequestModuleElement.cs
- OpenTypeLayoutCache.cs
- ProcessInfo.cs
- __Filters.cs
- GenerateHelper.cs
- PartitionResolver.cs
- SelectionProviderWrapper.cs
- DecoratedNameAttribute.cs
- CompiledIdentityConstraint.cs
- SqlSupersetValidator.cs
- NamedPipeChannelFactory.cs
- ZipFileInfo.cs
- InputLanguage.cs
- EntityDataSourceChangingEventArgs.cs
- MatrixTransform.cs
- BitmapFrameEncode.cs
- SubqueryTrackingVisitor.cs
- ObjectCloneHelper.cs
- CodePropertyReferenceExpression.cs
- DefaultAsyncDataDispatcher.cs
- PageParserFilter.cs
- UnconditionalPolicy.cs
- HexParser.cs
- InvalidMessageContractException.cs
- RayHitTestParameters.cs
- FontStretchConverter.cs
- ObjectItemCollection.cs
- SmtpNetworkElement.cs
- OperationBehaviorAttribute.cs
- DesignerActionUIService.cs
- MetadataArtifactLoaderCompositeResource.cs
- PropertyBuilder.cs
- WebDescriptionAttribute.cs
- DeferredRunTextReference.cs
- ContextMarshalException.cs
- SqlClientFactory.cs
- Stylesheet.cs
- EncryptedPackageFilter.cs
- EventSinkHelperWriter.cs
- ResourceExpression.cs
- SchemaNotation.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- ExpressionVisitor.cs
- WsdlInspector.cs
- ScriptControlDescriptor.cs
- RootBrowserWindow.cs
- MappingMetadataHelper.cs
- NavigateEvent.cs
- IisTraceListener.cs
- ToolCreatedEventArgs.cs
- _UncName.cs
- HtmlTextArea.cs
- XamlSerializer.cs
- MenuCommandsChangedEventArgs.cs
- AutomationPropertyInfo.cs
- CodeSnippetCompileUnit.cs
- ProcessExitedException.cs
- _CommandStream.cs
- UnauthorizedAccessException.cs
- RuleSettingsCollection.cs
- ClientProxyGenerator.cs
- NotFiniteNumberException.cs
- Point3D.cs