Last post Jul 30, 2018 08:42 PM by MelissaLynn
Jul 27, 2018 08:55 PM|MelissaLynn|LINK
Whenever data in a SQL table changes I want to use SignalR to show the changes immediately on my user interface (Asp.NET MVC EF6). So I started researching and found the article below on codeproject.com. My solution is a little different though because
I have multiple projects (WEB, DATA- this project has my repositories, migrations, unit of work, DbContext, etc., SERVICE, MODEL). In my DATA project I added the repository similar to the example but where I'm stuck is the SQL dependency OnChange method because my
Hub is in my web project. Do I pass the Hub from the web project to the service/repository? I don't think it makes sense to add SignalR NuGet package to my DATA project. Can anyone give me some pointers?
Jul 30, 2018 02:22 PM|mgebhard|LINK
The data access project is either a DLL in the web application or a DLL in a service. Basically, your question is irrelevant because the executing code is in the web or service project.
Jul 30, 2018 08:42 PM|MelissaLynn|LINK
Here is my problem. I have this code in my repository. MessagesHub does not exist in my repository (DATA) project. It only exists in the WEB project. How can I make it work?
private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
if (e.Type == SqlNotificationType.Change)
//I get an error here because MessagesHub does not exist. The Hub is inside my web project. How do I fix this?