/// <inheritdoc /> public async Task AddAsync(TEntity entity, CancellationToken cancellation = default(CancellationToken)) { IAsyncStoreContracts.AddAsync(entity); cancellation.ThrowIfCancellationRequested(); await this.store.AddAsync(entity, cancellation).DontMarshallContext(); }
/// <inheritdoc /> public Task AddAsync <TEntity>( TEntity entity, CancellationToken cancellation = default(CancellationToken)) where TEntity : class { IAsyncStoreContracts.AddAsync(entity); cancellation.ThrowIfCancellationRequested(); return(this.connection.InsertAsync(entity, cancellation)); }
/// <inheritdoc /> public async Task AddAsync <TEntity>( TEntity entity, CancellationToken cancellation = default(CancellationToken)) where TEntity : class { IAsyncStoreContracts.AddAsync(entity); var store = await this.GetStoreAsync <TEntity>(cancellation).DontMarshallContext(); await store.AddAsync(entity, cancellation).DontMarshallContext(); }
/// <inheritdoc /> public async Task AddAsync <TEntity>( TEntity entity, CancellationToken cancellation = default(CancellationToken)) where TEntity : class { IAsyncStoreContracts.AddAsync(entity); cancellation.ThrowIfCancellationRequested(); using (await this.Lock.WriterLockAsync(cancellation).DontMarshallContext()) { cancellation.ThrowIfCancellationRequested(); await this.store.AddAsync(entity, cancellation).DontMarshallContext(); } }