Entity Framework data updates in a multi-user environment with central database

前端 未结 2 1663
日久生厌
日久生厌 2021-01-12 03:45

Let me explain the title.

I\'m using Entity Framework Code First in an application (TestApp). For debugging purposes the TestApp connects t

相关标签:
2条回答
  • 2021-01-12 04:18

    There is nothing you can use to notify clients using entity framework. You can write an overload for SaveChanges, or create extension method but as far as you do not have client->server architecture I can not imagine how you can achieve this.

    If you use WCF as your gateway to the database, you could create duplex communication between your client and server and as new records are available clients would be notified using Callback Channel.

    Another approach is to use MS SQL Service Broker Overview (Service Broker)

    Despite the fact, that there are many different ways to get desired result, none of them are related to entity framework as it is ORM nor a application framework or Communication framework for applications built with .NET.

    0 讨论(0)
  • 2021-01-12 04:34

    This is not the responsibility of EF, it is more down to your general application design. A relatively simple background or periodic polling process would solve your problem.

    There are more considerations when dealing with multiple users, such as record locking and it may be an idea to do a little research into this side of things and come back if and when you have a specific problem.

    0 讨论(0)
提交回复
热议问题