Missing calls to method AsObservable - oriches/Resharper.ReactivePlugin GitHub Wiki

[Back to Code Analysis & Inspection] (https://github.com/oriches/Resharper.ReactivePlugin/wiki/Code-Analysis-&-Inspection)

Adds a hint highlight to public properties & methods which expose an IObservable<T> instance which has not called AsObservable to hide declaring stream types.

MSDN description of AsObservable can be found at http://msdn.microsoft.com/en-us/library/hh211761(v=vs.103).aspx.

Imagine we have the following class with a public property exposing a Subject<T>, it doesn't have to be a Subject<T> it could be any type implementing the IObservable<T> interface:

public class ExampleClass
{
    private readonly Subject<Unit> _subject = new Subject<Unit>();

    public IObservable<Unit> ExampleProperty
    {
        get { return _subject; }
    }
}

With the plugin installed this would be annotated with a Resharper hint as follows:

Missing AsObservable annotation

To resolve the highlight you simply add a call to AsObservable():

![Resolved AsObservable annotation] (http://oi47.tinypic.com/24b2f87.jpg)

The plugin will apply this annotation to any public property (including auto-properties) & methods.

There is a Resharper 'quick fix' associated with this [highlight] (https://github.com/oriches/Resharper.ReactivePlugin/wiki/Add-method-AsObservable).

⚠️ **GitHub.com Fallback** ⚠️