Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / CommandTrees / Internal / ParameterRetriever.cs / 1305376 / ParameterRetriever.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Globalization; using System.Data.Common; using System.Data.Metadata.Edm; using System.Linq; using System.Diagnostics; namespace System.Data.Common.CommandTrees.Internal { internal sealed class ParameterRetriever : BasicCommandTreeVisitor { private readonly DictionaryparamMappings = new Dictionary (); private ParameterRetriever() { } internal static System.Collections.ObjectModel.ReadOnlyCollection GetParameters(DbCommandTree tree) { Debug.Assert(tree != null, "Ensure command tree is non-null before calling ParamterRetriever.GetParameters"); ParameterRetriever retriever = new ParameterRetriever(); retriever.VisitCommandTree(tree); return retriever.paramMappings.Values.ToList().AsReadOnly(); } public override void Visit(DbParameterReferenceExpression expression) { Debug.Assert(expression != null, "Command tree subexpressions should never be null"); this.paramMappings[expression.ParameterName] = expression; } } } // 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.Globalization; using System.Data.Common; using System.Data.Metadata.Edm; using System.Linq; using System.Diagnostics; namespace System.Data.Common.CommandTrees.Internal { internal sealed class ParameterRetriever : BasicCommandTreeVisitor { private readonly DictionaryparamMappings = new Dictionary (); private ParameterRetriever() { } internal static System.Collections.ObjectModel.ReadOnlyCollection GetParameters(DbCommandTree tree) { Debug.Assert(tree != null, "Ensure command tree is non-null before calling ParamterRetriever.GetParameters"); ParameterRetriever retriever = new ParameterRetriever(); retriever.VisitCommandTree(tree); return retriever.paramMappings.Values.ToList().AsReadOnly(); } public override void Visit(DbParameterReferenceExpression expression) { Debug.Assert(expression != null, "Command tree subexpressions should never be null"); this.paramMappings[expression.ParameterName] = expression; } } } // 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
- CodeSubDirectoriesCollection.cs
- Property.cs
- TextContainer.cs
- ToolStripDropDown.cs
- CryptoHelper.cs
- QuotedPrintableStream.cs
- DbMetaDataColumnNames.cs
- UnsafeNativeMethods.cs
- GeometryModel3D.cs
- WebRequestModuleElement.cs
- StrokeIntersection.cs
- WebPartsPersonalizationAuthorization.cs
- DataGridSortingEventArgs.cs
- VectorValueSerializer.cs
- VectorCollectionValueSerializer.cs
- WindowsTreeView.cs
- SiteMapProvider.cs
- ThreadLocal.cs
- EntityParameterCollection.cs
- MemoryMappedViewStream.cs
- InvalidAsynchronousStateException.cs
- HelpProvider.cs
- SiteMapDesignerDataSourceView.cs
- BamlLocalizableResource.cs
- RangeContentEnumerator.cs
- Formatter.cs
- SemanticResultValue.cs
- SubclassTypeValidatorAttribute.cs
- FormViewUpdateEventArgs.cs
- Polyline.cs
- KernelTypeValidation.cs
- Compiler.cs
- Bind.cs
- XmlEntity.cs
- AuthorizationSection.cs
- CreateUserWizardStep.cs
- FreezableCollection.cs
- PkcsMisc.cs
- StringToken.cs
- SystemIPInterfaceStatistics.cs
- TrailingSpaceComparer.cs
- EntityParameter.cs
- ElementAction.cs
- namescope.cs
- XmlDictionary.cs
- DataGridViewCellPaintingEventArgs.cs
- ClientSettings.cs
- _SslState.cs
- PropertyValueUIItem.cs
- PropertyMetadata.cs
- MultiAsyncResult.cs
- MainMenu.cs
- RelationshipConverter.cs
- ListItemCollection.cs
- EventData.cs
- ThumbAutomationPeer.cs
- DebugHandleTracker.cs
- ProcessHostServerConfig.cs
- AsyncCompletedEventArgs.cs
- DBSchemaTable.cs
- Content.cs
- CustomAssemblyResolver.cs
- CounterSample.cs
- CompilerInfo.cs
- IdleTimeoutMonitor.cs
- ObjectContextServiceProvider.cs
- HwndHostAutomationPeer.cs
- ModuleBuilder.cs
- ColumnClickEvent.cs
- TableHeaderCell.cs
- XPathNavigator.cs
- NavigationWindowAutomationPeer.cs
- XmlSchemaSimpleContent.cs
- UnionQueryOperator.cs
- ChineseLunisolarCalendar.cs
- AutomationPeer.cs
- SqlExpander.cs
- SimpleApplicationHost.cs
- PenCursorManager.cs
- ExpressionBuilderCollection.cs
- BindToObject.cs
- PartialClassGenerationTaskInternal.cs
- SharedDp.cs
- FileClassifier.cs
- _PooledStream.cs
- ManifestSignedXml.cs
- ActivityExecutionFilter.cs
- XPathCompileException.cs
- SharedMemory.cs
- FixedHighlight.cs
- PolygonHotSpot.cs
- StylusPointProperty.cs
- FormViewInsertedEventArgs.cs
- KeyPressEvent.cs
- EndPoint.cs
- TemplateField.cs
- AppearanceEditorPart.cs
- MediaTimeline.cs
- HandlerBase.cs
- metrodevice.cs