EF 4 Self Tracking Entities does not work as expected

前端 未结 5 1217
不思量自难忘°
不思量自难忘° 2021-01-25 18:16

I am using EF4 Self Tracking Entities (VS2010 Beta 2 CTP 2 plus new T4 generator). But when I try to update entity information it does not update to database as expected.

<
5条回答
  •  无人及你
    2021-01-25 19:14

    I had the same exact problem and found the solution.

    It appears that for the self-tracking entities to automatically start tracking, you need to reference your STE project before adding the service reference.

    This way Visual Studio generates some .datasource files which does the final trick.

    I found the solution here: http://blogs.u2u.be/diederik/post/2010/05/18/Self-Tracking-Entities-with-Validation-and-Tracking-State-Change-Notification.aspx

    As for starting the tracking manually, it seems that you do not have these methods on the client-side.

    Hope it helps...

提交回复
热议问题