Ejemplo n.º 1
0
 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);
Ejemplo n.º 2
0
 public static IObservable <TEntity> Modify <TEntity>(this ISink <TEntity> sink, IObservable <TEntity> entities)
     where TEntity : class
 => sink.Change(EntityChange.Modify, entities);
Ejemplo n.º 3
0
 public static IObservable <TEntity> Delete <TEntity>(this ISink <TEntity> sink, IObservable <TEntity> entities)
     where TEntity : class
 => sink.Change(EntityChange.Delete, entities);
Ejemplo n.º 4
0
 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);