0

Essentially, I have two applications, the first one will modify a row in a table, and I want the second application to get notified about this modification and execute a piece of code that will display the most recent data in the table.

Of course, I could just put my code inside an infinite while loop, but I believe that this approach is not as good as running code only if changes have been made already.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
muhammed-shihebi
  • 134
  • 2
  • 11
  • 1
    BTW there is nothing out of the box in EF (core or v6) that would allow you to do this. You would have to use ado.net for a push approach as opposed to polling. Personally I would use a polling approach, use a recurring timer and check for changes every X where X is some meaningful time frequency (maybe 5 seconds or 1 minute or whatever is acceptable). – Igor Sep 07 '21 at 12:20
  • I know about SqlDependency Class in ado.net, but I am looking for something using EFC. I could not find anything out of the box as you mentioned. – muhammed-shihebi Sep 07 '21 at 12:23
  • 2
    EF Core uses ADO.NET, just like all other ORMs. It's not an alternative data access library, it's built on top of ADO.NET. That solution *is* out-of-the-box. Although a far better solution would be to *not* communicate through the database (that's what you're trying to do) but actually have one application talk to the other. Communicating through the database doesn't scale well *and* ties the two applications together – Panagiotis Kanavos Sep 07 '21 at 12:58
  • Voted to close as "opinion-based" (only the close reason with most votes is visible). It's impossible to give one decisive answer here, which is one of the touchstones of on-topic-ness on Stack Overflow. – Gert Arnold Sep 07 '21 at 13:40

0 Answers0