SignalR Service Broker with data from SQL View, does it work? MVC 5 ASP.NET

910 views Asked by At

I've used SignalR with some Databases in SQL in my MVC 5 web application to update the Webpage when table data is modified. My question is...

Can I use a MessagesRepository that uses a SqlCommand to a SQL View? Does a SQL View fire a Service Broker event? I'm very new to SignalR and just wanted to know if I could use my SQL Views or if I needed to copy the views query into the Message Repository or not.

If you need some code for examples, I'll see what I can do.

1

There are 1 answers

1
Remus Rusanu On BEST ANSWER

Unfortunately views are explicitly called out as invalid in Special Considerations When Using Query Notifications:

  • The statement must reference a base table.
  • The statement must not reference a view.

Before you move the view definition up into the client app, you need to make sure the query in the view is a valid query for QN, see the restrictions above.