Train
Train

Reputation: 3496

Tracking table changes in ASP.NET core 2 and EF

I am working on integrations so I am building an api in .NET Core 2 and Entity Framework 7 for a system that was built in ASP.NET MVC 5 and EF 6 to communicate with other API's. Here is an image of what it looks like

enter image description here

I would like my asp.net core 2 API to listen to changes in SQL Server rather than being notified by the MVC app every time a change happens.

I read this article here sqldependency. SQLdependency is around 15 years old, is this still the standard way of listening to DB changes or is there another way I could do this?

Upvotes: 4

Views: 3663

Answers (1)

Programudo
Programudo

Reputation: 56

In Ado.net were a class SqlDependency for that kind of notification, on EF do not supported, but here are some samples

https://web.archive.org/web/20150916155640/https://code.msdn.microsoft.com/How-to-use-SqlDependency-5c0da0b3

www.codeproject.com/Articles/496484/SqlDependency-with-Entity-Framework

And in this question talk about some issues

Is SqlDependency supported in .NET Core?

Upvotes: 4

Related Questions