public TransformStub() { TransformFactory = (p) => { var result = new PersonWithGender(p, p.Age % 2 == 0 ? "M" : "F"); return(Task.FromResult(result)); }; Results = new ChangeSetAggregator <PersonWithGender, string>(Source.Connect().TransformSafeAsync(TransformFactory, ErrorHandler)); }
public TransformStub(IObservable <Func <Person, bool> > retransformer) { TransformFactory = (p) => { var result = new PersonWithGender(p, p.Age % 2 == 0 ? "M" : "F"); return(Task.FromResult(result)); }; Results = new ChangeSetAggregator <PersonWithGender, string> ( Source.Connect().TransformAsync(TransformFactory, retransformer.Select(selector => { Func <Person, string, bool> transformed = (p, key) => selector(p); return(transformed); })) ); }
public TransformStub(IObservable <Unit> retransformer) { TransformFactory = (p) => { var result = new PersonWithGender(p, p.Age % 2 == 0 ? "M" : "F"); return(Task.FromResult(result)); }; Results = new ChangeSetAggregator <PersonWithGender, string> ( Source.Connect().TransformSafeAsync(TransformFactory, ErrorHandler, retransformer.Select(x => { bool Transformer(Person p, string key) => true; return((Func <Person, string, bool>)Transformer); })) ); }