Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Common / internal / materialization / shaperfactory.cs / 3 / shaperfactory.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System.Data.Common.QueryCache; using System.Data.Metadata.Edm; using System.Data.Objects; using System.Data.Objects.Internal; using System.Data.Query.InternalTrees; using System.Diagnostics; namespace System.Data.Common.Internal.Materialization { ////// An immutable type used to generate Shaper instances. /// internal abstract class ShaperFactory { internal static ShaperFactory Create(Type elementType, QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer) { ShaperFactoryCreator creator = (ShaperFactoryCreator)Activator.CreateInstance(typeof(TypedShaperFactoryCreator<>).MakeGenericType(elementType)); return creator.TypedCreate(cacheManager, columnMap, metadata, spanInfo, mergeOption, valueLayer); } private abstract class ShaperFactoryCreator { internal abstract ShaperFactory TypedCreate(QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer); } private sealed class TypedShaperFactoryCreator: ShaperFactoryCreator { public TypedShaperFactoryCreator() {} internal override ShaperFactory TypedCreate(QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer) { return Translator.TranslateColumnMap (cacheManager, columnMap, metadata, spanInfo, mergeOption, valueLayer); } } } /// /// Typed ShaperFactory /// internal class ShaperFactory: ShaperFactory { private readonly int _stateCount; private readonly CoordinatorFactory _rootCoordinatorFactory; private readonly Action _checkPermissions; private readonly MergeOption _mergeOption; internal ShaperFactory(int stateCount, CoordinatorFactory rootCoordinatorFactory, Action checkPermissions, MergeOption mergeOption) { _stateCount = stateCount; _rootCoordinatorFactory = rootCoordinatorFactory; _checkPermissions = checkPermissions; _mergeOption = mergeOption; } /// /// Factory method to create the Shaper for Object Layer queries. /// internal ShaperCreate(DbDataReader reader, ObjectContext context, MetadataWorkspace workspace, MergeOption mergeOption) { Debug.Assert(mergeOption == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, context, workspace, mergeOption, _stateCount, _rootCoordinatorFactory, _checkPermissions); } /// /// Factory method to create the Shaper for Value Layer queries. /// internal ShaperCreate(DbDataReader reader, MetadataWorkspace workspace) { Debug.Assert(MergeOption.NoTracking == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, null, workspace, MergeOption.NoTracking, _stateCount, _rootCoordinatorFactory, _checkPermissions); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System.Data.Common.QueryCache; using System.Data.Metadata.Edm; using System.Data.Objects; using System.Data.Objects.Internal; using System.Data.Query.InternalTrees; using System.Diagnostics; namespace System.Data.Common.Internal.Materialization { ////// An immutable type used to generate Shaper instances. /// internal abstract class ShaperFactory { internal static ShaperFactory Create(Type elementType, QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer) { ShaperFactoryCreator creator = (ShaperFactoryCreator)Activator.CreateInstance(typeof(TypedShaperFactoryCreator<>).MakeGenericType(elementType)); return creator.TypedCreate(cacheManager, columnMap, metadata, spanInfo, mergeOption, valueLayer); } private abstract class ShaperFactoryCreator { internal abstract ShaperFactory TypedCreate(QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer); } private sealed class TypedShaperFactoryCreator: ShaperFactoryCreator { public TypedShaperFactoryCreator() {} internal override ShaperFactory TypedCreate(QueryCacheManager cacheManager, ColumnMap columnMap, MetadataWorkspace metadata, SpanIndex spanInfo, MergeOption mergeOption, bool valueLayer) { return Translator.TranslateColumnMap (cacheManager, columnMap, metadata, spanInfo, mergeOption, valueLayer); } } } /// /// Typed ShaperFactory /// internal class ShaperFactory: ShaperFactory { private readonly int _stateCount; private readonly CoordinatorFactory _rootCoordinatorFactory; private readonly Action _checkPermissions; private readonly MergeOption _mergeOption; internal ShaperFactory(int stateCount, CoordinatorFactory rootCoordinatorFactory, Action checkPermissions, MergeOption mergeOption) { _stateCount = stateCount; _rootCoordinatorFactory = rootCoordinatorFactory; _checkPermissions = checkPermissions; _mergeOption = mergeOption; } /// /// Factory method to create the Shaper for Object Layer queries. /// internal ShaperCreate(DbDataReader reader, ObjectContext context, MetadataWorkspace workspace, MergeOption mergeOption) { Debug.Assert(mergeOption == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, context, workspace, mergeOption, _stateCount, _rootCoordinatorFactory, _checkPermissions); } /// /// Factory method to create the Shaper for Value Layer queries. /// internal ShaperCreate(DbDataReader reader, MetadataWorkspace workspace) { Debug.Assert(MergeOption.NoTracking == _mergeOption, "executing a query with a different mergeOption than was used to compile the delegate"); return new Shaper (reader, null, workspace, MergeOption.NoTracking, _stateCount, _rootCoordinatorFactory, _checkPermissions); } } } // 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
- SecurityElement.cs
- CalloutQueueItem.cs
- QilUnary.cs
- OdbcTransaction.cs
- RecognizedAudio.cs
- DoubleConverter.cs
- PaginationProgressEventArgs.cs
- SQLByteStorage.cs
- SqlBulkCopy.cs
- CodeSnippetExpression.cs
- NamespaceMapping.cs
- MouseButtonEventArgs.cs
- ListBoxChrome.cs
- DocumentGridContextMenu.cs
- XmlChoiceIdentifierAttribute.cs
- RegexGroupCollection.cs
- UserNamePasswordValidationMode.cs
- MetabaseSettings.cs
- ProcessHostMapPath.cs
- SelfIssuedAuthAsymmetricKey.cs
- CryptoApi.cs
- ObjectStateManager.cs
- XamlWriter.cs
- ObjectPersistData.cs
- RestHandlerFactory.cs
- Point4DConverter.cs
- DataGridViewCheckBoxColumn.cs
- GACIdentityPermission.cs
- Registry.cs
- JoinGraph.cs
- ContainerUIElement3D.cs
- TextSelectionHighlightLayer.cs
- ConsoleKeyInfo.cs
- ZipFileInfo.cs
- MimeTypeMapper.cs
- MaterialGroup.cs
- mediapermission.cs
- IQueryable.cs
- userdatakeys.cs
- Avt.cs
- XmlSerializationWriter.cs
- PersistenceMetadataNamespace.cs
- CustomSignedXml.cs
- ReadOnlyCollection.cs
- ControlAdapter.cs
- ColumnPropertiesGroup.cs
- EntityDataSourceState.cs
- JpegBitmapDecoder.cs
- HtmlElement.cs
- EntryWrittenEventArgs.cs
- HybridCollection.cs
- ServiceRoute.cs
- SqlHelper.cs
- DataPagerFieldCommandEventArgs.cs
- RenderData.cs
- RemotingServices.cs
- ToolBar.cs
- AmbientProperties.cs
- DocumentReference.cs
- HttpRequestTraceRecord.cs
- XmlResolver.cs
- RichTextBox.cs
- Site.cs
- HwndSource.cs
- DictionaryContent.cs
- DataPagerFieldCommandEventArgs.cs
- DefaultAssemblyResolver.cs
- ValidationErrorInfo.cs
- EmbeddedMailObjectCollectionEditor.cs
- MembershipValidatePasswordEventArgs.cs
- XmlSchemaObjectTable.cs
- CustomTypeDescriptor.cs
- Matrix3D.cs
- ErrorLog.cs
- SecurityContextTokenCache.cs
- NeutralResourcesLanguageAttribute.cs
- SimpleMailWebEventProvider.cs
- CallSite.cs
- DefaultBinder.cs
- RegistryConfigurationProvider.cs
- _SafeNetHandles.cs
- BrowserInteropHelper.cs
- NodeLabelEditEvent.cs
- _ProxyChain.cs
- ClientUrlResolverWrapper.cs
- SupportsEventValidationAttribute.cs
- SecUtil.cs
- ClientConfigPaths.cs
- Terminate.cs
- XmlSchemaInferenceException.cs
- ParserHooks.cs
- ClientTarget.cs
- SqlBuilder.cs
- SharedRuntimeState.cs
- ArraySortHelper.cs
- TransformedBitmap.cs
- NetStream.cs
- DataGridViewBand.cs
- SafeNativeMemoryHandle.cs
- AutomationPropertyInfo.cs