none
container for IObservable of different types.

    Question

  • Hi, 

    my final goal is to cycle through out a certain structure of observable and, for each element apply the same operator

    ...
    myCurrentObservable = myCurrentObservable.Where(x => myCondition)     ..or  .Subscribe() ... or whatever...
    ...

    the problem is... what if my first IObservable is for esample IObservable<long>, the socond  IObservable<int>, the third IObservable<MyClass> and so on? 

    Hope that's clear many tnx!


    • Edited by AndreaPi Wednesday, September 07, 2016 1:37 PM
    Wednesday, September 07, 2016 1:34 PM

Answers

  • IObservable<object> o = ...

    o.OfType<int>.Where(i => i > 0) ...

    o.OfType<string>.Where(s => s != null) ...

    • Marked as answer by AndreaPi Wednesday, September 07, 2016 3:00 PM
    Wednesday, September 07, 2016 2:47 PM