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
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro