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
- XsltOutput.cs
- WindowsGraphics2.cs
- NativeRecognizer.cs
- AuthenticationModulesSection.cs
- CompilerResults.cs
- Pts.cs
- OdbcException.cs
- IndentTextWriter.cs
- XmlHierarchicalDataSourceView.cs
- TableAdapterManagerHelper.cs
- LinqDataSourceHelper.cs
- TiffBitmapEncoder.cs
- ObservableDictionary.cs
- StandardTransformFactory.cs
- ResourcesChangeInfo.cs
- Operand.cs
- CodeTypeOfExpression.cs
- VirtualizingStackPanel.cs
- LinkTarget.cs
- TemplateBindingExtension.cs
- odbcmetadatacollectionnames.cs
- ConnectionModeReader.cs
- ModifierKeysConverter.cs
- Vector3dCollection.cs
- EUCJPEncoding.cs
- CapacityStreamGeometryContext.cs
- DiscoveryInnerClientAdhocCD1.cs
- EventLogWatcher.cs
- TypeSystem.cs
- RSAPKCS1SignatureDeformatter.cs
- SplitContainer.cs
- SubstitutionResponseElement.cs
- _NetworkingPerfCounters.cs
- SelectionRange.cs
- ListenerElementsCollection.cs
- EventRoute.cs
- ExternalException.cs
- FlowNode.cs
- DataGridViewAdvancedBorderStyle.cs
- HttpSessionStateBase.cs
- ContentType.cs
- X509Certificate2.cs
- SystemTcpConnection.cs
- PageCopyCount.cs
- GlobalizationAssembly.cs
- RequestQueryProcessor.cs
- ActivityDesignerAccessibleObject.cs
- EntityChangedParams.cs
- EdmProperty.cs
- EncodingStreamWrapper.cs
- RegistrationServices.cs
- DataGridViewCellPaintingEventArgs.cs
- MetadataUtil.cs
- TreeViewImageKeyConverter.cs
- FlowDocumentPage.cs
- LayoutEngine.cs
- DBPropSet.cs
- DefaultCommandConverter.cs
- TypeLibConverter.cs
- SynchronizedInputHelper.cs
- DbExpressionBuilder.cs
- EntitySetDataBindingList.cs
- Calendar.cs
- SHA1Managed.cs
- ApplicationProxyInternal.cs
- TextRangeSerialization.cs
- WindowsUpDown.cs
- StorageComplexTypeMapping.cs
- OutputCacheProfile.cs
- MessagePartSpecification.cs
- GlobalEventManager.cs
- NamespaceCollection.cs
- AttachedPropertyMethodSelector.cs
- SQLInt32Storage.cs
- LinkedDataMemberFieldEditor.cs
- XslCompiledTransform.cs
- _CacheStreams.cs
- UpdateInfo.cs
- HandledMouseEvent.cs
- BitmapEffectCollection.cs
- ControlTemplate.cs
- AppDomainUnloadedException.cs
- DataGridHeaderBorder.cs
- ColorAnimationBase.cs
- TypeConverter.cs
- BasicViewGenerator.cs
- errorpatternmatcher.cs
- WebEvents.cs
- RelativeSource.cs
- InteropBitmapSource.cs
- ListViewDataItem.cs
- FunctionParameter.cs
- ProjectionCamera.cs
- LinkButton.cs
- WebPartTransformerAttribute.cs
- StyleXamlParser.cs
- ToolStripStatusLabel.cs
- ThemeDirectoryCompiler.cs
- XmlArrayAttribute.cs
- SizeChangedEventArgs.cs