Let\'s say, we have a class:
public class Foo
{
public string Do(int param)
{
}
}
I\'d like to create an observable of values that are
Observable.Generate solves your problem, although you don't need to use the condition and the continue for your sample. This just creates and object and continually returns the result of the call to DoIt():
Observable.Generate (
new Foo(),
item => true, // in your example, this never terminates
item => item, // we don't actually do any state transitions
item => { return item.DoIt(); } // This is where we emit our value
);
In practice, you often do want to track some state and have some termination condition. Generate makes it easy.