SqlPersistenceProviderFactory.CreateProvider(Guid) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new LockingPersistenceProvider instance that uses a SQL database as its persistence store.
public:
override System::ServiceModel::Persistence::PersistenceProvider ^ CreateProvider(Guid id);
public override System.ServiceModel.Persistence.PersistenceProvider CreateProvider (Guid id);
override this.CreateProvider : Guid -> System.ServiceModel.Persistence.PersistenceProvider
Public Overrides Function CreateProvider (id As Guid) As PersistenceProvider
Parameters
- id
- Guid
The unique identifier of the persistence provider being created.
Returns
A newly-created PersistenceProvider.
Examples
The following code example shows how to execute the CreateProvider
method. Note that the resulting provider is accessed as a LockingPersistenceProvider instance.
SqlPersistenceProviderFactory factory = new SqlPersistenceProviderFactory(
DataBaseConstants.ConnectionString,
false,
TimeSpan.FromSeconds(60));
LockingPersistenceProvider provider = (LockingPersistenceProvider)factory.CreateProvider(Guid.NewGuid());
Remarks
The initialized persistence provider uses the current parameters of the creating factory (ConnectionString, LockTimeout, and SerializeAsText), even if the factory's parameters are changed after the persistence provider is created.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈