Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / internal / materialization / shaperfactory.cs / 1 / 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
- MainMenu.cs
- UnaryOperationBinder.cs
- ListControlConvertEventArgs.cs
- TableStyle.cs
- SwitchExpression.cs
- EraserBehavior.cs
- GridLengthConverter.cs
- LineServicesCallbacks.cs
- BevelBitmapEffect.cs
- DataView.cs
- ToolStripDesignerUtils.cs
- ProfileProvider.cs
- EFTableProvider.cs
- GeneralTransform2DTo3DTo2D.cs
- KnownBoxes.cs
- Delegate.cs
- TypeUnloadedException.cs
- FakeModelItemImpl.cs
- Listbox.cs
- ConfigurationException.cs
- XmlComplianceUtil.cs
- Control.cs
- ResourceWriter.cs
- EntityDataSourceDesignerHelper.cs
- VectorCollectionConverter.cs
- httpapplicationstate.cs
- LineGeometry.cs
- StorageInfo.cs
- CodeMemberMethod.cs
- EntityDataSourceViewSchema.cs
- HWStack.cs
- TextRunTypographyProperties.cs
- Pointer.cs
- VoiceChangeEventArgs.cs
- SmtpNegotiateAuthenticationModule.cs
- TextTreeDeleteContentUndoUnit.cs
- CacheRequest.cs
- DataListItem.cs
- DetectRunnableInstancesTask.cs
- HashStream.cs
- X509Utils.cs
- HeaderLabel.cs
- Canvas.cs
- XamlToRtfWriter.cs
- DbConnectionPoolGroup.cs
- HMACSHA1.cs
- BitmapVisualManager.cs
- DataBoundControlAdapter.cs
- SimpleHandlerBuildProvider.cs
- AssemblyCollection.cs
- PrePrepareMethodAttribute.cs
- TextTabProperties.cs
- NativeMethods.cs
- EncodingTable.cs
- TdsParserStaticMethods.cs
- NullableConverter.cs
- CommentGlyph.cs
- SqlFacetAttribute.cs
- CommonXSendMessage.cs
- WsdlWriter.cs
- XmlSchemaInferenceException.cs
- MenuBase.cs
- GPPOINTF.cs
- PropertyDescriptor.cs
- PointHitTestResult.cs
- JoinSymbol.cs
- DateTimeSerializationSection.cs
- Formatter.cs
- MissingMethodException.cs
- EntityException.cs
- ItemsControlAutomationPeer.cs
- NullableBoolConverter.cs
- RemoteCryptoDecryptRequest.cs
- UserControl.cs
- ScopedKnownTypes.cs
- ResolveResponseInfo.cs
- CriticalHandle.cs
- _ListenerRequestStream.cs
- CollectionViewSource.cs
- WebReferencesBuildProvider.cs
- _HeaderInfoTable.cs
- AnnotationService.cs
- LambdaCompiler.Binary.cs
- RefreshEventArgs.cs
- TypeConverterMarkupExtension.cs
- ChangePassword.cs
- RoleGroupCollection.cs
- ReadOnlyObservableCollection.cs
- ProcessModule.cs
- TraceContext.cs
- ClientBuildManager.cs
- CodeAccessPermission.cs
- CompilationRelaxations.cs
- HeaderCollection.cs
- ProfileParameter.cs
- DeobfuscatingStream.cs
- MatrixConverter.cs
- Internal.cs
- SharedConnectionListener.cs
- HijriCalendar.cs