0
votes

I am beginer with SignalR. My website is developing with ASP.NET MVC5 I am trying to create a live notification like Facebook, everybody advise I should use SignalR.

I tried to use SignalR with sample code at here http://techbrij.com/database-change-notifications-asp-net-signalr-sqldependency but unfortunately, my hosting admin said that they can not Grant subscribe permission for my sql user so I can not do like this tip.

Do you have any advise for me to using SignalR without subscribe permission? I only need :

  • The count of number notifications
  • The content of notification will be show like Facebook.
1

1 Answers

0
votes

Instead of having SQL notify when updates happens do it from the domain. Use a EventAggregator

like https://www.nuget.org/packages/Caliburn.Micro.EventAggregator/

from your repository or other place were you update the database do

public void UpdateFoo(Foo foo) 
{
   ... //Update here
   this.eventAggregator.Publish(new UpdatedEvent<Foo>(foo);
}

You can use my library if you want to seamless forward these events to the clients

https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy/wiki