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)));
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))) );
public static IObservable <BatchProcessResult> UploadBatch( IAuctionProcedures soap, IImageLookup imgs, Consent c, IEnumerable <Lot> input) => input.ToObservable().SelectMany(x => Upload(soap, imgs, c, x));