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
- Transactions.cs
- xsdvalidator.cs
- WebFormsRootDesigner.cs
- XmlDocumentFragment.cs
- BitmapScalingModeValidation.cs
- EventOpcode.cs
- ParentQuery.cs
- SuppressMessageAttribute.cs
- DelimitedListTraceListener.cs
- SecurityKeyIdentifierClause.cs
- TimeManager.cs
- CharacterString.cs
- ViewPort3D.cs
- DefaultWorkflowTransactionService.cs
- Registry.cs
- Tracer.cs
- typedescriptorpermissionattribute.cs
- NameTable.cs
- BlockUIContainer.cs
- KeyedCollection.cs
- ExpandCollapseProviderWrapper.cs
- EventLogPermission.cs
- Stackframe.cs
- BitmapEffectInputData.cs
- ClientSponsor.cs
- CreateUserErrorEventArgs.cs
- X509Chain.cs
- TCPClient.cs
- WebPartConnectionsConnectVerb.cs
- WebPartUtil.cs
- TimeSpanHelper.cs
- ObfuscationAttribute.cs
- NameHandler.cs
- SelectedGridItemChangedEvent.cs
- PartialTrustHelpers.cs
- BaseAppDomainProtocolHandler.cs
- MarshalDirectiveException.cs
- AppDomain.cs
- InputProcessorProfilesLoader.cs
- ObjectQuery_EntitySqlExtensions.cs
- ProbeMatchesApril2005.cs
- IndexedGlyphRun.cs
- DiscoveryRequestHandler.cs
- SimpleLine.cs
- InvalidProgramException.cs
- CheckBoxList.cs
- DbDeleteCommandTree.cs
- HtmlEncodedRawTextWriter.cs
- HttpModulesSection.cs
- TextTreeInsertUndoUnit.cs
- ProviderConnectionPointCollection.cs
- PassportAuthentication.cs
- AttachmentCollection.cs
- Hashtable.cs
- BaseCodePageEncoding.cs
- CustomServiceCredentials.cs
- ProcessHostFactoryHelper.cs
- DataServiceRequestException.cs
- TextSegment.cs
- StringUtil.cs
- DesignerForm.cs
- ReferencedCollectionType.cs
- WindowsIPAddress.cs
- InheritedPropertyDescriptor.cs
- ListenerChannelContext.cs
- BindingMAnagerBase.cs
- ImageFormat.cs
- ProxyHelper.cs
- ReliableSession.cs
- shaperfactoryquerycacheentry.cs
- ListControl.cs
- AsyncDataRequest.cs
- DebugView.cs
- QueryReaderSettings.cs
- SingleAnimation.cs
- CachingHintValidation.cs
- ImageCollectionEditor.cs
- ServiceMoniker.cs
- InputLanguageCollection.cs
- keycontainerpermission.cs
- fixedPageContentExtractor.cs
- SiteIdentityPermission.cs
- XmlName.cs
- XmlILAnnotation.cs
- JsonQueryStringConverter.cs
- KeyGesture.cs
- ResourceContainer.cs
- PixelFormat.cs
- StringAnimationUsingKeyFrames.cs
- SqlDataSourceCache.cs
- DataAccessor.cs
- StorageEntityTypeMapping.cs
- TimeSpanConverter.cs
- EventToken.cs
- ComponentEditorForm.cs
- EncryptedReference.cs
- UniqueID.cs
- ListViewPagedDataSource.cs
- FontEmbeddingManager.cs
- Semaphore.cs