Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DLinq / Dlinq / SqlClient / Query / SqlAggregateChecker.cs / 1305376 / SqlAggregateChecker.cs
using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Data.Linq; namespace System.Data.Linq.SqlClient { internal class SqlAggregateChecker { Visitor visitor; internal SqlAggregateChecker() { this.visitor = new Visitor(); } internal bool HasAggregates(SqlNode node) { visitor.hasAggregates = false; visitor.Visit(node); return visitor.hasAggregates; } class Visitor : SqlVisitor { internal bool hasAggregates; internal Visitor() { } internal override SqlExpression VisitSubSelect(SqlSubSelect ss) { return ss; } internal override SqlSource VisitSource(SqlSource source) { return source; } internal override SqlExpression VisitUnaryOperator(SqlUnary uo) { switch (uo.NodeType) { case SqlNodeType.Min: case SqlNodeType.Max: case SqlNodeType.Avg: case SqlNodeType.Sum: case SqlNodeType.Count: case SqlNodeType.LongCount: this.hasAggregates = true; return uo; default: return base.VisitUnaryOperator(uo); } } } } } // 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
- SerialErrors.cs
- BinaryNode.cs
- MessageFault.cs
- Missing.cs
- DataObjectCopyingEventArgs.cs
- SqlGatherProducedAliases.cs
- SchemaMapping.cs
- XsltLibrary.cs
- SafeUserTokenHandle.cs
- BufferedResponseStream.cs
- HttpDebugHandler.cs
- RelatedView.cs
- InputScopeNameConverter.cs
- WebPartCatalogCloseVerb.cs
- SafeRightsManagementPubHandle.cs
- PeerNameRecordCollection.cs
- CodeArrayIndexerExpression.cs
- SmtpSection.cs
- PersistencePipeline.cs
- AmbientLight.cs
- Comparer.cs
- RemotingConfigParser.cs
- Point3DCollection.cs
- HtmlInputRadioButton.cs
- ServiceContractAttribute.cs
- GridViewCellAutomationPeer.cs
- TypeInfo.cs
- ClientType.cs
- DateTimeConverter2.cs
- TargetConverter.cs
- ColorBlend.cs
- EditorPartChrome.cs
- SingleStorage.cs
- LineGeometry.cs
- BaseHashHelper.cs
- EventsTab.cs
- PropertyEmitter.cs
- ImageMetadata.cs
- SpinWait.cs
- DocumentViewerAutomationPeer.cs
- ProviderException.cs
- RectKeyFrameCollection.cs
- Point3DCollection.cs
- IteratorFilter.cs
- ToolStripPanelCell.cs
- Operators.cs
- HttpDigestClientElement.cs
- BulletChrome.cs
- wgx_exports.cs
- Keyboard.cs
- TemplatedAdorner.cs
- OracleLob.cs
- RuntimeArgument.cs
- ObjectHandle.cs
- WinCategoryAttribute.cs
- GZipStream.cs
- BindingMemberInfo.cs
- BamlBinaryReader.cs
- PolyLineSegment.cs
- ToolStripItemEventArgs.cs
- EventPrivateKey.cs
- DoWorkEventArgs.cs
- BinaryObjectInfo.cs
- Int16Converter.cs
- TouchPoint.cs
- UnicodeEncoding.cs
- ToolStripPanel.cs
- SortQuery.cs
- DataGridCommandEventArgs.cs
- PartialClassGenerationTask.cs
- BamlLocalizableResourceKey.cs
- LowerCaseStringConverter.cs
- MailBnfHelper.cs
- RepeatButtonAutomationPeer.cs
- ComplexBindingPropertiesAttribute.cs
- BindingList.cs
- EventMemberCodeDomSerializer.cs
- DictionaryEntry.cs
- ErrorItem.cs
- HttpClientCertificate.cs
- ThousandthOfEmRealDoubles.cs
- SqlUtils.cs
- ByteFacetDescriptionElement.cs
- TableParaClient.cs
- DataShape.cs
- SafeFileMappingHandle.cs
- EmissiveMaterial.cs
- WebServiceMethodData.cs
- DockAndAnchorLayout.cs
- RelationshipEnd.cs
- HostingEnvironmentSection.cs
- ForwardPositionQuery.cs
- WebHttpBindingCollectionElement.cs
- BuildDependencySet.cs
- UnsafeNativeMethodsPenimc.cs
- SamlAttribute.cs
- SmtpDigestAuthenticationModule.cs
- ChangePassword.cs
- ExtentCqlBlock.cs
- CapacityStreamGeometryContext.cs