public static Task <TEntity> GetOrNullAsync <TKey, TEntity>( this IAsyncStore store, TKey key, CancellationToken cancellation = default(CancellationToken)) where TEntity : class, IKeyed <TKey> { GetMethodContracts(store, key); return(store.WhereAsync((TEntity entity) => entity.Key.Equals(key)).SingleOrDefaultAsync()); }
public MigratedAsyncStore(IAsyncStoreMigrator migrator, IAsyncStore store) { Contracts.Requires.That(migrator != null); Contracts.Requires.That(store != null); this.store = store; this.Initialization = migrator.MigrateAsync(); }
public static Task AddOrIgnoreAllAsync <TEntity>( this IAsyncStore store, CancellationToken cancellation, params TEntity[] entities) where TEntity : class { AllMethodContracts(store, entities); return(store.AddOrIgnoreAllAsync(entities, cancellation)); }
public static Task <TryValue <TEntity> > TryGetAsync <TKey, TEntity>( this IAsyncStore <TEntity> store, TKey key, CancellationToken cancellation = default(CancellationToken)) where TEntity : class, IKeyed <TKey> { GetMethodContracts(store, key); return(store.WhereAsync(entity => entity.Key.Equals(key)).SingleOrNoneAsync()); }
public LockedAsyncStore(IAsyncStore store) { Contracts.Requires.That(store != null); this.store = store; }
public KeyValueStore(IAsyncStore <TEntity> store) { Contracts.Requires.That(store != null); this.store = store; }
public SkyIslandMapChunkStore(IAsyncStore store) { Contracts.Requires.That(store != null); this.store = store; }
public VoxelGridChunkStore(IAsyncStore store) { Contracts.Requires.That(store != null); this.store = store; }
public static Task AddOrIgnoreAllAsync <TEntity>(this IAsyncStore store, params TEntity[] entities) where TEntity : class => store.AddOrIgnoreAllAsync(CancellationToken.None, entities);
private static void AllMethodContracts <TEntity>(this IAsyncStore <TEntity> store, TEntity[] entities) where TEntity : class { Contracts.Requires.That(store != null); Contracts.Requires.That(entities.AllAndSelfNotNull()); }
private static void GetMethodContracts <TKey, TEntity>(this IAsyncStore <TEntity> store, TKey key) where TEntity : class, IKeyed <TKey> { Contracts.Requires.That(store != null); Contracts.Requires.That(key != null); }
private static void GetMethodContracts <TKey>(this IAsyncStore store, TKey key) { Contracts.Requires.That(store != null); Contracts.Requires.That(key != null); }
public static Task RemoveAllAsync <TEntity>( this IAsyncStore <TEntity> store, params TEntity[] entities) where TEntity : class => store.RemoveAllAsync(CancellationToken.None, entities);
public ManagerBase(IAsyncStore <T, TKey> store) { Store = store; }