Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / CommandTrees / ExpressionBindings.cs / 1305376 / ExpressionBindings.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; using System.Data.Common; using System.Data.Common.Utils; using System.Data.Metadata.Edm; using System.Data.Common.CommandTrees.Internal; using System.Data.Common.CommandTrees.ExpressionBuilder; namespace System.Data.Common.CommandTrees { ////// Describes a binding for an expression. Conceptually similar to a foreach loop /// in C#. The DbExpression property defines the collection being iterated over, /// while the Var property provides a means to reference the current element /// of the collection during the iteration. DbExpressionBinding is used to describe the set arguments /// to relational expressions such as ///, /// and . /// /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public sealed class DbExpressionBinding { private readonly DbExpression _expr; private readonly DbVariableReferenceExpression _varRef; internal DbExpressionBinding(DbExpression input, DbVariableReferenceExpression varRef) { Debug.Assert(input != null, "DbExpressionBinding input cannot be null"); Debug.Assert(varRef != null, "DbExpressionBinding variable cannot be null"); _expr = input; _varRef = varRef; } /// /// Gets the public DbExpression Expression { get { return _expr; } } ///that defines the input set. /// /// Gets the name assigned to the element variable. /// public string VariableName { get { return _varRef.VariableName; } } ////// Gets the type metadata of the element variable. /// public TypeUsage VariableType { get { return _varRef.ResultType; } } ////// Gets the public DbVariableReferenceExpression Variable { get { return _varRef;} } } ///that references the element variable. /// /// Defines the binding for the input set to a [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public sealed class DbGroupExpressionBinding { private /*readonly*/ DbExpression _expr; private readonly DbVariableReferenceExpression _varRef; private readonly DbVariableReferenceExpression _groupVarRef; private DbGroupAggregate _groupAggregate; internal DbGroupExpressionBinding(DbExpression input, DbVariableReferenceExpression inputRef, DbVariableReferenceExpression groupRef) { _expr = input; _varRef = inputRef; _groupVarRef = groupRef; } ///. /// In addition to the properties of , DbGroupExpressionBinding /// also provides access to the group element via the variable reference /// and to the group aggregate via the property. /// /// Gets the public DbExpression Expression { get { return _expr; } } ///that defines the input set. /// /// Gets the name assigned to the element variable. /// public string VariableName { get { return _varRef.VariableName; } } ////// Gets the type metadata of the element variable. /// public TypeUsage VariableType { get { return _varRef.ResultType; } } ////// Gets the DbVariableReferenceExpression that references the element variable. /// public DbVariableReferenceExpression Variable { get { return _varRef; } } ////// Gets the name assigned to the group element variable. /// public string GroupVariableName { get { return _groupVarRef.VariableName; } } ////// Gets the type metadata of the group element variable. /// public TypeUsage GroupVariableType { get { return _groupVarRef.ResultType; } } ////// Gets the DbVariableReferenceExpression that references the group element variable. /// public DbVariableReferenceExpression GroupVariable { get { return _groupVarRef; } } ////// Gets the DbGroupAggregate that represents the collection of elements of the group. /// public DbGroupAggregate GroupAggregate { get { if (_groupAggregate == null) { _groupAggregate = DbExpressionBuilder.GroupAggregate(this.GroupVariable); } return _groupAggregate; } } } } // 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.Diagnostics; using System.Data.Common; using System.Data.Common.Utils; using System.Data.Metadata.Edm; using System.Data.Common.CommandTrees.Internal; using System.Data.Common.CommandTrees.ExpressionBuilder; namespace System.Data.Common.CommandTrees { ////// Describes a binding for an expression. Conceptually similar to a foreach loop /// in C#. The DbExpression property defines the collection being iterated over, /// while the Var property provides a means to reference the current element /// of the collection during the iteration. DbExpressionBinding is used to describe the set arguments /// to relational expressions such as ///, /// and . /// /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public sealed class DbExpressionBinding { private readonly DbExpression _expr; private readonly DbVariableReferenceExpression _varRef; internal DbExpressionBinding(DbExpression input, DbVariableReferenceExpression varRef) { Debug.Assert(input != null, "DbExpressionBinding input cannot be null"); Debug.Assert(varRef != null, "DbExpressionBinding variable cannot be null"); _expr = input; _varRef = varRef; } /// /// Gets the public DbExpression Expression { get { return _expr; } } ///that defines the input set. /// /// Gets the name assigned to the element variable. /// public string VariableName { get { return _varRef.VariableName; } } ////// Gets the type metadata of the element variable. /// public TypeUsage VariableType { get { return _varRef.ResultType; } } ////// Gets the public DbVariableReferenceExpression Variable { get { return _varRef;} } } ///that references the element variable. /// /// Defines the binding for the input set to a [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")] public sealed class DbGroupExpressionBinding { private /*readonly*/ DbExpression _expr; private readonly DbVariableReferenceExpression _varRef; private readonly DbVariableReferenceExpression _groupVarRef; private DbGroupAggregate _groupAggregate; internal DbGroupExpressionBinding(DbExpression input, DbVariableReferenceExpression inputRef, DbVariableReferenceExpression groupRef) { _expr = input; _varRef = inputRef; _groupVarRef = groupRef; } ///. /// In addition to the properties of , DbGroupExpressionBinding /// also provides access to the group element via the variable reference /// and to the group aggregate via the property. /// /// Gets the public DbExpression Expression { get { return _expr; } } ///that defines the input set. /// /// Gets the name assigned to the element variable. /// public string VariableName { get { return _varRef.VariableName; } } ////// Gets the type metadata of the element variable. /// public TypeUsage VariableType { get { return _varRef.ResultType; } } ////// Gets the DbVariableReferenceExpression that references the element variable. /// public DbVariableReferenceExpression Variable { get { return _varRef; } } ////// Gets the name assigned to the group element variable. /// public string GroupVariableName { get { return _groupVarRef.VariableName; } } ////// Gets the type metadata of the group element variable. /// public TypeUsage GroupVariableType { get { return _groupVarRef.ResultType; } } ////// Gets the DbVariableReferenceExpression that references the group element variable. /// public DbVariableReferenceExpression GroupVariable { get { return _groupVarRef; } } ////// Gets the DbGroupAggregate that represents the collection of elements of the group. /// public DbGroupAggregate GroupAggregate { get { if (_groupAggregate == null) { _groupAggregate = DbExpressionBuilder.GroupAggregate(this.GroupVariable); } return _groupAggregate; } } } } // 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
- RegularExpressionValidator.cs
- RuntimeIdentifierPropertyAttribute.cs
- HideDisabledControlAdapter.cs
- PropertyEmitterBase.cs
- CodeTypeDelegate.cs
- SubstitutionDesigner.cs
- DiscoveryDocument.cs
- BamlLocalizableResource.cs
- WebPermission.cs
- InvalidDataException.cs
- IssuanceTokenProviderState.cs
- AuthenticationException.cs
- WindowsPen.cs
- RsaKeyGen.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- XPathNavigatorReader.cs
- SelectedPathEditor.cs
- DataFormat.cs
- DES.cs
- MultiAsyncResult.cs
- ResourceDictionaryCollection.cs
- SqlDataSourceRefreshSchemaForm.cs
- SqlFacetAttribute.cs
- Tuple.cs
- WebPartChrome.cs
- RealizationContext.cs
- InvokeWebServiceDesigner.cs
- GeneralTransform3DGroup.cs
- OdbcDataReader.cs
- SqlConnectionManager.cs
- XmlUtilWriter.cs
- DeclarationUpdate.cs
- SchemaNamespaceManager.cs
- DesignerView.Commands.cs
- ContainsSearchOperator.cs
- BaseServiceProvider.cs
- SerializerDescriptor.cs
- ConstructorNeedsTagAttribute.cs
- CachedCompositeFamily.cs
- DataGridViewCellValidatingEventArgs.cs
- CustomAssemblyResolver.cs
- SqlBuffer.cs
- Opcode.cs
- XmlHelper.cs
- RowBinding.cs
- _RequestCacheProtocol.cs
- Keyboard.cs
- TypeConstant.cs
- RouteUrlExpressionBuilder.cs
- HighlightComponent.cs
- SchemaComplexType.cs
- ToolStripManager.cs
- Operators.cs
- PeerNameResolver.cs
- DataGridViewCellPaintingEventArgs.cs
- TextRangeAdaptor.cs
- ArrayList.cs
- DataControlCommands.cs
- NotSupportedException.cs
- FormsAuthenticationCredentials.cs
- IISMapPath.cs
- RelationshipManager.cs
- ScrollViewerAutomationPeer.cs
- LineSegment.cs
- CookieParameter.cs
- CodeDomConfigurationHandler.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- RegionData.cs
- StyleXamlParser.cs
- ActiveXSite.cs
- AsyncStreamReader.cs
- SqlFileStream.cs
- PEFileReader.cs
- Cursor.cs
- DataListCommandEventArgs.cs
- AliasedExpr.cs
- AsymmetricSecurityProtocolFactory.cs
- SponsorHelper.cs
- RawStylusInputCustomDataList.cs
- MultipleViewProviderWrapper.cs
- SoapInteropTypes.cs
- InvalidEnumArgumentException.cs
- RequiredFieldValidator.cs
- InputEventArgs.cs
- UnsafeNetInfoNativeMethods.cs
- ManagementEventWatcher.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ChannelFactoryBase.cs
- TextAnchor.cs
- DependencyPropertyAttribute.cs
- BitStream.cs
- TraceContextRecord.cs
- ObjectTypeMapping.cs
- ProjectionCamera.cs
- XmlMemberMapping.cs
- IdentityManager.cs
- ListItemCollection.cs
- EnumUnknown.cs
- InvalidPropValue.cs
- SecondaryIndexList.cs