PersistenceProvider.Create(Object, TimeSpan) Método

Definição

Quando implementado em uma classe derivada, cria um registro de estado do serviço no repositório de persistência.When implemented in a derived class, creates a service state record in the persistence store.

public:
 abstract System::Object ^ Create(System::Object ^ instance, TimeSpan timeout);
public abstract object Create (object instance, TimeSpan timeout);
abstract member Create : obj * TimeSpan -> obj
Public MustOverride Function Create (instance As Object, timeout As TimeSpan) As Object

Parâmetros

instance
Object

O estado da instância real.The actual instance state.

timeout
TimeSpan

O período após o qual o provedor de persistência anula esta tentativa.The time period after which the persistence provider aborts this attempt.

Retornos

Object

O token de instância correspondente ao estado recém-salvo.The instance token corresponding to the state just saved. Isso pode ser passado para LoadIfChanged(TimeSpan, Object, Object) para determinar se o estado no repositório de persistência é diferente do estado de quando Create foi chamado.This can be passed to LoadIfChanged(TimeSpan, Object, Object) to determine whether the state in the persistence store differs from the state when Create was called.

Exemplos

O código a seguir demonstra como implementar o Create método.The following code demonstrates how to implement the Create method.

public override object Create(object instance, TimeSpan timeout)
{
    base.ThrowIfDisposedOrNotOpen();
    this.factory.Create(this.Id, instance, timeout);
    return null;
}

Aplica-se a