Subscribing to a category from C#

Hello,

Is it possible to subscribe to a category from a C# client?

E.g., an equivalent to fromCategory(‘instrument’) in a JS projection?

I understand I can work around this by creating this projection and subscribing to “all_instruments” stream instead:

fromCategory(‘instrument’).when({

$any: function(s, e) {

linkTo(‘all_instruments’, e)

}

})

It would be nice not to have to do it though. :slight_smile:

Thanks,

Igor.

If you have the by category projection enabled, subscribe to $category-whatever stream.

Cheers,

James

That stream only contains StreamCreated events, not the events from the actual “instrument-…” streams.

Ah, good point. Yes in that case you’ll need an extra projection to emit links to the events.

Cheers,

James

Got it, thank you.

Igor,

The $ce- stream contains linkTo events to all the events in the category. You are free to use these streams in 2.x version, however the structure of system streams may change in the future (in case of a distributed system). We will provide a ClientAPI way to read category in this case.

-yuriy

Excellent, 1 projection down.

Is this still the way I should read all events from a category with the C# API?