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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기