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
- Deflater.cs
- ManageRequest.cs
- TypeBrowser.xaml.cs
- DefaultValueTypeConverter.cs
- RunClient.cs
- HTMLTextWriter.cs
- EditingMode.cs
- CompositeScriptReference.cs
- CollectionChangedEventManager.cs
- SingleConverter.cs
- Classification.cs
- RequestUriProcessor.cs
- PropertyMetadata.cs
- KeyboardDevice.cs
- EncoderNLS.cs
- MultitargetingHelpers.cs
- NonDualMessageSecurityOverHttp.cs
- SHA512Managed.cs
- AdapterDictionary.cs
- Select.cs
- RangeValuePattern.cs
- ContractMapping.cs
- ListenerSessionConnectionReader.cs
- Matrix.cs
- NamespaceEmitter.cs
- util.cs
- OleDbReferenceCollection.cs
- ImmutableAssemblyCacheEntry.cs
- ToolBarDesigner.cs
- Message.cs
- HtmlTitle.cs
- HyperLink.cs
- EventLogPermissionEntry.cs
- SplineKeyFrames.cs
- InternalControlCollection.cs
- DefaultProxySection.cs
- SegmentInfo.cs
- HtmlInputText.cs
- DesignerMetadata.cs
- PropertyCondition.cs
- TableCellCollection.cs
- cookie.cs
- RunInstallerAttribute.cs
- HttpChannelFactory.cs
- CodeConstructor.cs
- OrderedDictionaryStateHelper.cs
- DoubleLinkList.cs
- StoragePropertyMapping.cs
- WebPartMenu.cs
- GeneratedContractType.cs
- HotCommands.cs
- DocumentManager.cs
- Mapping.cs
- Point3DCollectionConverter.cs
- ElementHostPropertyMap.cs
- DataDesignUtil.cs
- TreeNode.cs
- ContextMarshalException.cs
- SystemIcons.cs
- DataSourceCollectionBase.cs
- FocusManager.cs
- AttributeTableBuilder.cs
- StylusDevice.cs
- MouseButtonEventArgs.cs
- CodeIterationStatement.cs
- CompositeCollection.cs
- ToolBarTray.cs
- OleDbSchemaGuid.cs
- BrushValueSerializer.cs
- ActivityTypeCodeDomSerializer.cs
- SqlClientMetaDataCollectionNames.cs
- AspCompat.cs
- ColorAnimation.cs
- COM2ExtendedUITypeEditor.cs
- NamedPipeProcessProtocolHandler.cs
- COM2IDispatchConverter.cs
- XmlSignificantWhitespace.cs
- MsmqBindingElementBase.cs
- ThreadAbortException.cs
- NTAccount.cs
- AudioFormatConverter.cs
- RuntimeHelpers.cs
- FormatSettings.cs
- SqlNotificationEventArgs.cs
- BufferAllocator.cs
- ProfileInfo.cs
- Walker.cs
- SoapElementAttribute.cs
- RootBuilder.cs
- DBCommand.cs
- HttpCookiesSection.cs
- IPEndPoint.cs
- SettingsPropertyCollection.cs
- QueryContinueDragEvent.cs
- Utilities.cs
- WebDescriptionAttribute.cs
- EnterpriseServicesHelper.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- GenericPrincipal.cs
- ObjectIDGenerator.cs