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
- SqlGenericUtil.cs
- AvTrace.cs
- FileUtil.cs
- DataGridAutoFormat.cs
- HttpHeaderCollection.cs
- SimpleHandlerBuildProvider.cs
- HighlightVisual.cs
- HttpCapabilitiesBase.cs
- MobileCapabilities.cs
- SendDesigner.xaml.cs
- AuthorizationSection.cs
- BufferedGraphicsManager.cs
- SafeThreadHandle.cs
- ScrollItemPattern.cs
- PartialCachingAttribute.cs
- Interlocked.cs
- TrustManagerPromptUI.cs
- LabelEditEvent.cs
- EdmProviderManifest.cs
- MexHttpBindingElement.cs
- IdleTimeoutMonitor.cs
- dbenumerator.cs
- OleDbConnectionFactory.cs
- TypedRowHandler.cs
- ZipIORawDataFileBlock.cs
- XmlSchemaSimpleContentRestriction.cs
- WebPartsSection.cs
- InputLanguage.cs
- _ScatterGatherBuffers.cs
- JsonReaderWriterFactory.cs
- ObjectConverter.cs
- TemplateControlCodeDomTreeGenerator.cs
- XPathPatternParser.cs
- FixedSOMImage.cs
- FontCacheLogic.cs
- MessagePropertyDescriptionCollection.cs
- DocComment.cs
- WindowsListViewSubItem.cs
- ExtensionSimplifierMarkupObject.cs
- VersionConverter.cs
- ProviderIncompatibleException.cs
- NavigationCommands.cs
- SharedDp.cs
- ItemCheckedEvent.cs
- CompilationRelaxations.cs
- ProfileService.cs
- SchemaEntity.cs
- CatalogPartChrome.cs
- SchemaCollectionPreprocessor.cs
- SqlUtil.cs
- TableRowCollection.cs
- DataGridViewTextBoxEditingControl.cs
- BookmarkEventArgs.cs
- TextTreeInsertElementUndoUnit.cs
- Collection.cs
- StringArrayConverter.cs
- StringWriter.cs
- SkewTransform.cs
- DataSourceProvider.cs
- GatewayIPAddressInformationCollection.cs
- LinqDataView.cs
- Container.cs
- regiisutil.cs
- WindowsGraphics.cs
- Win32.cs
- COM2IDispatchConverter.cs
- MailAddressCollection.cs
- EventBuilder.cs
- WmiInstallComponent.cs
- CheckBoxStandardAdapter.cs
- SystemIPAddressInformation.cs
- SecureStringHasher.cs
- ViewCellRelation.cs
- CodeNamespace.cs
- QilSortKey.cs
- ObjectMaterializedEventArgs.cs
- SecureConversationVersion.cs
- Utility.cs
- WinFormsComponentEditor.cs
- MetafileHeaderWmf.cs
- MenuStrip.cs
- ConstructorNeedsTagAttribute.cs
- ExpandCollapseProviderWrapper.cs
- DataListItemEventArgs.cs
- TreeNodeMouseHoverEvent.cs
- CharKeyFrameCollection.cs
- XsltLoader.cs
- SuppressIldasmAttribute.cs
- SpecularMaterial.cs
- ComponentChangedEvent.cs
- EventEntry.cs
- StandardToolWindows.cs
- RuntimeCompatibilityAttribute.cs
- WorkflowApplicationAbortedException.cs
- ControlCachePolicy.cs
- Matrix3D.cs
- SqlDataSourceCommandEventArgs.cs
- ObjectDataSourceEventArgs.cs
- Geometry.cs
- NamedPermissionSet.cs