Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / CommandTrees / DbQueryCommandTree.cs / 2 / DbQueryCommandTree.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 query operation expressed as a canonical command tree. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public sealed class DbQueryCommandTree : DbCommandTree { private ExpressionLink _query; ////// Gets or sets an ///that defines the logic of the query operation. /// The expression is null ///The expression is associated with a different command tree public DbExpression Query { get { return _query.Expression; } /*CQT_PUBLIC_API(*/internal/*)*/ set { using (new EntityBid.ScopeAuto("%d#", this.ObjectId)) { EntityBid.Trace(" %d#, value=%d#, %d{cqt.DbExpressionKind}\n", this.ObjectId, DbExpression.GetObjectId(value), DbExpression.GetExpressionKind(value)); _query.Expression = value; } } } /// /// Constructs a new DbQueryCommandTree that uses the specified metadata workspace. /// /// 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/*)*/ DbQueryCommandTree(MetadataWorkspace metadata, DataSpace dataSpace) : base(metadata, dataSpace) { using (new EntityBid.ScopeAuto(" does not represent a valid data space %d#", this.ObjectId)) { _query = new ExpressionLink("Query", this); } } /// /// Clones this command tree. This operation creates a new DbQueryCommandTree for which each expression property value is a clone of the corresponding property of this command tree. /// ///The cloned command tree /*CQT_PUBLIC_API(*/internal/*)*/ DbQueryCommandTree Clone() { using (new EntityBid.ScopeAuto("%d#", this.ObjectId)) { DbQueryCommandTree newTree = new DbQueryCommandTree( this.MetadataWorkspace, this.DataSpace ); this.CopyParametersTo(newTree); if (this.Query != null) { newTree.Query = ExpressionCopier.Copy(newTree, this.Query); } return newTree; } } internal override DbCommandTreeKind CommandTreeKind { get { return DbCommandTreeKind.Query; } } internal override void DumpStructure(ExpressionDumper dumper) { if (this.Query != null) { dumper.Dump(this.Query, "Query"); } } internal override string PrintTree(ExpressionPrinter printer) { return printer.Print(this); } internal override void Replace(ExpressionReplacer replacer) { using (new EntityBid.ScopeAuto(" %d#", this.ObjectId)) { if (this.Query != null) { DbExpression newQuery = replacer.Replace(this.Query); if (!object.ReferenceEquals(newQuery, this.Query)) { this.Query = newQuery; } } } } internal override void Validate(System.Data.Common.CommandTrees.Internal.Validator v) { using (new EntityBid.ScopeAuto(" %d#", this.ObjectId)) { v.Validate(this); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------- // // 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 query operation expressed as a canonical command tree. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public sealed class DbQueryCommandTree : DbCommandTree { private ExpressionLink _query; ////// Gets or sets an ///that defines the logic of the query operation. /// The expression is null ///The expression is associated with a different command tree public DbExpression Query { get { return _query.Expression; } /*CQT_PUBLIC_API(*/internal/*)*/ set { using (new EntityBid.ScopeAuto("%d#", this.ObjectId)) { EntityBid.Trace(" %d#, value=%d#, %d{cqt.DbExpressionKind}\n", this.ObjectId, DbExpression.GetObjectId(value), DbExpression.GetExpressionKind(value)); _query.Expression = value; } } } /// /// Constructs a new DbQueryCommandTree that uses the specified metadata workspace. /// /// 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/*)*/ DbQueryCommandTree(MetadataWorkspace metadata, DataSpace dataSpace) : base(metadata, dataSpace) { using (new EntityBid.ScopeAuto(" does not represent a valid data space %d#", this.ObjectId)) { _query = new ExpressionLink("Query", this); } } /// /// Clones this command tree. This operation creates a new DbQueryCommandTree for which each expression property value is a clone of the corresponding property of this command tree. /// ///The cloned command tree /*CQT_PUBLIC_API(*/internal/*)*/ DbQueryCommandTree Clone() { using (new EntityBid.ScopeAuto("%d#", this.ObjectId)) { DbQueryCommandTree newTree = new DbQueryCommandTree( this.MetadataWorkspace, this.DataSpace ); this.CopyParametersTo(newTree); if (this.Query != null) { newTree.Query = ExpressionCopier.Copy(newTree, this.Query); } return newTree; } } internal override DbCommandTreeKind CommandTreeKind { get { return DbCommandTreeKind.Query; } } internal override void DumpStructure(ExpressionDumper dumper) { if (this.Query != null) { dumper.Dump(this.Query, "Query"); } } internal override string PrintTree(ExpressionPrinter printer) { return printer.Print(this); } internal override void Replace(ExpressionReplacer replacer) { using (new EntityBid.ScopeAuto(" %d#", this.ObjectId)) { if (this.Query != null) { DbExpression newQuery = replacer.Replace(this.Query); if (!object.ReferenceEquals(newQuery, this.Query)) { this.Query = newQuery; } } } } internal override void Validate(System.Data.Common.CommandTrees.Internal.Validator v) { using (new EntityBid.ScopeAuto(" %d#", this.ObjectId)) { v.Validate(this); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CurrencyWrapper.cs
- CommandBinding.cs
- CalendarAutomationPeer.cs
- QilParameter.cs
- Model3DGroup.cs
- SafeNativeMethods.cs
- RequestStatusBarUpdateEventArgs.cs
- DropSource.cs
- InvalidPrinterException.cs
- SHA1CryptoServiceProvider.cs
- HttpWebResponse.cs
- CodeCommentStatementCollection.cs
- Vector3DAnimation.cs
- ProjectedSlot.cs
- SettingsSection.cs
- FormViewPageEventArgs.cs
- DataSourceConverter.cs
- SubordinateTransaction.cs
- AutomationInteropProvider.cs
- XsdBuildProvider.cs
- ViewBox.cs
- webeventbuffer.cs
- WizardSideBarListControlItemEventArgs.cs
- EmptyCollection.cs
- NetworkStream.cs
- PointAnimationClockResource.cs
- GeneralTransform3DGroup.cs
- PermissionSetTriple.cs
- PathFigureCollection.cs
- StylusEditingBehavior.cs
- ClearTypeHintValidation.cs
- WebPartConnectionsDisconnectVerb.cs
- SRGSCompiler.cs
- CodeTypeDeclaration.cs
- NamedElement.cs
- ProgressBar.cs
- FunctionDescription.cs
- AnnotationResource.cs
- ThreadExceptionEvent.cs
- DataBinding.cs
- MemoryMappedView.cs
- LayoutUtils.cs
- SqlCommandSet.cs
- ClusterSafeNativeMethods.cs
- SqlDataSourceSummaryPanel.cs
- XmlSchemaExternal.cs
- QuestionEventArgs.cs
- TextBreakpoint.cs
- CellLabel.cs
- GradientSpreadMethodValidation.cs
- CodeTypeReferenceCollection.cs
- TypeViewSchema.cs
- AutomationElementCollection.cs
- BinHexDecoder.cs
- ZoneMembershipCondition.cs
- UntypedNullExpression.cs
- Utility.cs
- ADMembershipProvider.cs
- AssemblyAttributesGoHere.cs
- CodeValidator.cs
- RequestCachePolicy.cs
- ItemsPanelTemplate.cs
- RegistryPermission.cs
- EdmTypeAttribute.cs
- ServiceDeploymentInfo.cs
- ViewSimplifier.cs
- RegisteredArrayDeclaration.cs
- PartialTrustHelpers.cs
- SerialStream.cs
- HttpRequest.cs
- WorkflowQueue.cs
- BaseDataListDesigner.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- ToggleButtonAutomationPeer.cs
- PrimitiveCodeDomSerializer.cs
- FormViewModeEventArgs.cs
- AttributeInfo.cs
- NetworkCredential.cs
- AdCreatedEventArgs.cs
- UserControlFileEditor.cs
- WindowsListViewSubItem.cs
- SrgsGrammarCompiler.cs
- CalendarSelectionChangedEventArgs.cs
- ReadOnlyState.cs
- DetailsViewAutoFormat.cs
- CompositeControlDesigner.cs
- NaturalLanguageHyphenator.cs
- IndicCharClassifier.cs
- CodeGeneratorOptions.cs
- ReachPageContentSerializerAsync.cs
- cookie.cs
- TabControlAutomationPeer.cs
- VScrollProperties.cs
- MultiSelectRootGridEntry.cs
- DetailsViewModeEventArgs.cs
- X509Chain.cs
- COSERVERINFO.cs
- NotifyIcon.cs
- HttpStreamMessageEncoderFactory.cs
- LowerCaseStringConverter.cs