Пример #1
0
 static IObservable <Unit> AddImages(
     IAuctionProcedures soap,
     IImageLookup imgs,
     Consent c,
     AuctionHandle a) => Observable.Merge(
     imgs.Get(a.LotId)
     .Select(x => soap.AddImage(c, x, a.RequestId)));
Пример #2
0
 static IObservable <BatchProcessResult> Upload(IAuctionProcedures soap,
                                                IImageLookup imgs,
                                                Consent c,
                                                Lot input) =>
 CreateAuction(soap, c, input)
 .SelectMany(x => Observable.Concat(
                 Observable.Return(Add(x)),
                 AddImages(soap, imgs, c, x).Select(_ => Image(x)),
                 soap.Commit(c, x.RequestId).Select(_ => Commit(x)))
             );
Пример #3
0
 public static IObservable <IEnumerable <Status> > PollRequestOnQue(
     IAuctionProcedures soap,
     Consent c,
     IObservable <Unit> cue,
     IObservable <BatchProcessResult> requests) =>
 cue.WithLatestFrom(
     requests
     .Where(x => x.Process == Process.Add)
     .Scan(empty, (ids, r) => ids.Add(r.Auction.RequestId)),
     (_, rIds) => soap.GetResult(c, rIds))
 .Merge();
Пример #4
0
 public static IObservable <AuctionHandle> CreateAuction(
     IAuctionProcedures soap,
     Consent c,
     Lot l) => soap.AddLot(c, l);
Пример #5
0
 public static IObservable <BatchProcessResult> UploadBatch(
     IAuctionProcedures soap,
     IImageLookup imgs,
     Consent c,
     IEnumerable <Lot> input) =>
 input.ToObservable().SelectMany(x => Upload(soap, imgs, c, x));