Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / EntityClient / EntityProviderFactory.cs / 1 / EntityProviderFactory.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Text; using System.Data; using System.Data.Common; using System.Security; using System.Security.Permissions; namespace System.Data.EntityClient { ////// Class representing a provider factory for the entity client provider /// public sealed class EntityProviderFactory : DbProviderFactory, IServiceProvider { ////// A singleton object for the entity client provider factory object /// [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "EntityProviderFactory implements the singleton pattern and it's stateless. This is needed in order to work with DbProviderFactories.")] public static readonly EntityProviderFactory Instance = new EntityProviderFactory(); ////// Constructs the EntityProviderFactory object, this is private as users shouldn't create it directly /// private EntityProviderFactory() { } ////// Creates a EntityCommand object and returns it /// ///A EntityCommand object public override DbCommand CreateCommand() { return new EntityCommand(); } ////// Creates a EntityCommandBuilder object and returns it /// ///A EntityCommandBuilder object ///public override DbCommandBuilder CreateCommandBuilder() { throw EntityUtil.NotSupported(); } /// /// Creates a EntityConnection object and returns it /// ///A EntityConnection object public override DbConnection CreateConnection() { return new EntityConnection(); } ////// Creates a EntityConnectionStringBuilder object and returns it /// ///A EntityConnectionStringBuilder object public override DbConnectionStringBuilder CreateConnectionStringBuilder() { return new EntityConnectionStringBuilder(); } ////// Creates a DbDataAdapter object and returns it, this method is currently not supported /// ///A DbDataAdapter object ///public override DbDataAdapter CreateDataAdapter() { throw EntityUtil.NotSupported(); } /// /// Creates a EntityParameter object and returns it /// ///A EntityParameter object public override DbParameter CreateParameter() { return new EntityParameter(); } ////// Creates a CodeAccessPermission object and returns it /// /// The permission state level for the code access ///A CodeAccessPermission object public override CodeAccessPermission CreatePermission(PermissionState state) { throw EntityUtil.NotSupported(); } ////// Extension mechanism for additional services; /// ///requested service provider or null. object IServiceProvider.GetService(Type serviceType) { object result = null; if (serviceType == typeof(DbProviderServices)) { result = EntityProviderServices.Instance; } else if (serviceType == typeof(IEntityAdapter)) { result = new EntityAdapter(); } return result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Text; using System.Data; using System.Data.Common; using System.Security; using System.Security.Permissions; namespace System.Data.EntityClient { ////// Class representing a provider factory for the entity client provider /// public sealed class EntityProviderFactory : DbProviderFactory, IServiceProvider { ////// A singleton object for the entity client provider factory object /// [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "EntityProviderFactory implements the singleton pattern and it's stateless. This is needed in order to work with DbProviderFactories.")] public static readonly EntityProviderFactory Instance = new EntityProviderFactory(); ////// Constructs the EntityProviderFactory object, this is private as users shouldn't create it directly /// private EntityProviderFactory() { } ////// Creates a EntityCommand object and returns it /// ///A EntityCommand object public override DbCommand CreateCommand() { return new EntityCommand(); } ////// Creates a EntityCommandBuilder object and returns it /// ///A EntityCommandBuilder object ///public override DbCommandBuilder CreateCommandBuilder() { throw EntityUtil.NotSupported(); } /// /// Creates a EntityConnection object and returns it /// ///A EntityConnection object public override DbConnection CreateConnection() { return new EntityConnection(); } ////// Creates a EntityConnectionStringBuilder object and returns it /// ///A EntityConnectionStringBuilder object public override DbConnectionStringBuilder CreateConnectionStringBuilder() { return new EntityConnectionStringBuilder(); } ////// Creates a DbDataAdapter object and returns it, this method is currently not supported /// ///A DbDataAdapter object ///public override DbDataAdapter CreateDataAdapter() { throw EntityUtil.NotSupported(); } /// /// Creates a EntityParameter object and returns it /// ///A EntityParameter object public override DbParameter CreateParameter() { return new EntityParameter(); } ////// Creates a CodeAccessPermission object and returns it /// /// The permission state level for the code access ///A CodeAccessPermission object public override CodeAccessPermission CreatePermission(PermissionState state) { throw EntityUtil.NotSupported(); } ////// Extension mechanism for additional services; /// ///requested service provider or null. object IServiceProvider.GetService(Type serviceType) { object result = null; if (serviceType == typeof(DbProviderServices)) { result = EntityProviderServices.Instance; } else if (serviceType == typeof(IEntityAdapter)) { result = new EntityAdapter(); } return result; } } } // 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
- MatrixCamera.cs
- TextContainerChangedEventArgs.cs
- NotCondition.cs
- TcpChannelListener.cs
- ISCIIEncoding.cs
- SiteMapNodeCollection.cs
- AuthenticationConfig.cs
- HostedHttpTransportManager.cs
- OdbcDataReader.cs
- SystemKeyConverter.cs
- LogLogRecordEnumerator.cs
- CultureInfoConverter.cs
- EntityProviderFactory.cs
- ManagementException.cs
- VariableQuery.cs
- ByteKeyFrameCollection.cs
- Comparer.cs
- InputQueue.cs
- LoginUtil.cs
- Hashtable.cs
- DataGridViewRowPostPaintEventArgs.cs
- StructuredTypeInfo.cs
- InvalidProgramException.cs
- Span.cs
- URLAttribute.cs
- ScriptResourceHandler.cs
- XmlILOptimizerVisitor.cs
- EventSetter.cs
- Geometry.cs
- NamespaceCollection.cs
- LinqDataSourceEditData.cs
- OperationGenerator.cs
- GenericRootAutomationPeer.cs
- RuntimeUtils.cs
- FileDetails.cs
- ImageListDesigner.cs
- Logging.cs
- PhysicalFontFamily.cs
- ScriptHandlerFactory.cs
- HttpConfigurationSystem.cs
- WebPartZoneBase.cs
- PanelDesigner.cs
- OdbcCommandBuilder.cs
- LogFlushAsyncResult.cs
- XmlNamespaceDeclarationsAttribute.cs
- TcpProcessProtocolHandler.cs
- ExecutionContext.cs
- DataGridState.cs
- StylusButtonCollection.cs
- _AutoWebProxyScriptEngine.cs
- SizeConverter.cs
- SqlServer2KCompatibilityCheck.cs
- DocobjHost.cs
- Matrix.cs
- DataPagerField.cs
- CodeSnippetStatement.cs
- IntSecurity.cs
- Completion.cs
- SQLBinaryStorage.cs
- StopStoryboard.cs
- TraceSource.cs
- UrlEncodedParameterWriter.cs
- XsltConvert.cs
- TabControlToolboxItem.cs
- _AutoWebProxyScriptHelper.cs
- X509RecipientCertificateClientElement.cs
- DbMetaDataFactory.cs
- NumericUpDownAccelerationCollection.cs
- SearchForVirtualItemEventArgs.cs
- GestureRecognizer.cs
- SHA1Managed.cs
- SplitterDesigner.cs
- BehaviorEditorPart.cs
- SurrogateDataContract.cs
- Environment.cs
- ReliableChannelBinder.cs
- URLIdentityPermission.cs
- NavigationWindow.cs
- SplitterCancelEvent.cs
- PipeException.cs
- CodeIndexerExpression.cs
- ControlBindingsCollection.cs
- AndMessageFilterTable.cs
- ToolTipService.cs
- VerticalAlignConverter.cs
- RectangleHotSpot.cs
- BrowserCapabilitiesCompiler.cs
- ToolboxItemCollection.cs
- AsyncDataRequest.cs
- XamlTemplateSerializer.cs
- EventHandlers.cs
- EdgeProfileValidation.cs
- Config.cs
- ProcessMessagesAsyncResult.cs
- CodeTypeMemberCollection.cs
- NavigationProperty.cs
- WebBrowserPermission.cs
- MethodRental.cs
- WindowsGraphicsCacheManager.cs
- InheritanceUI.cs