Well, if the Observable
constructor has protected access, then you can't use it unless you're working in the Observable
class or a subclass of Observable
. So if you want to make this work with minimal changes you'll have to either make this class a subclass of Observable
or make the constructor public, but depending on your situation that may or may not be possible.
The reason the compiler is complaining about being unable to resolve add(rx.Observable)
is because it means exactly what it says. It can't find a method matching that combination of name/parameter in the Observable
class. Could be because the way you have Observable
parameterized, as it appears that add()
is looking for a different type than you want to put in.
I'm making a bit of a guess here as to the structure of Observable
, but the type of element that you're trying to add doesn't seem to match the type of element that dmRegistrations
takes. You declared that dmRegistrations
is Observable<Collection<DMRegistration>>
, which (I assume) means that you're observing Collection<DMRegistration>
. You're trying to add an object of type Observable<DMRegistration>
, which isn't what add()
is looking for, unless Observable
implements Collection
.