public static async Task ChangeRangeAsync <TEntity>(this ISink <TEntity> sink, EntityChange change, IEnumerable <TEntity> entities, CancellationToken cancellationToken, IScheduler scheduler = null) where TEntity : class => await sink.Change(change, entities.ToObservable(scheduler ?? Scheduler.Default)) .Count().ToTask(cancellationToken).ConfigureAwait(false);
public static IObservable <TEntity> Modify <TEntity>(this ISink <TEntity> sink, IObservable <TEntity> entities) where TEntity : class => sink.Change(EntityChange.Modify, entities);
public static IObservable <TEntity> Delete <TEntity>(this ISink <TEntity> sink, IObservable <TEntity> entities) where TEntity : class => sink.Change(EntityChange.Delete, entities);
public static IObservable <TEntity> Change <TEntity>(this ISink <TEntity> sink, EntityChange change, IObservable <TEntity> entities) where TEntity : class => sink.Change(entities.Select(e => new { e, change }).GroupBy(x => x.change, x => x.e)) .Select(x => x.Entity);