Questions tagged [self-tracking-entities]

In an Entity Framework-based application, a context is responsible for tracking changes in your objects. Self-Tracking Entities (STEs) can help you track changes in any tier and then replay these changes into a context to be saved.

In an Entity Framework-based application, a context is responsible for tracking changes in your objects. You then use the SaveChanges method to persist the changes to the database. When working with N-Tier applications, the entity objects are usually disconnected from the context and you must decide how to track changes and report those changes back to the context.

Self-Tracking Entities (STEs) can help you track changes in any tier and then replay these changes into a context to be saved.

WARNING: STEs are no longer recommended.

More Info

174 questions
1
vote
1 answer

WCF, Silverlight 5, Self Tracking Entities, and (de)serialization

I am working on a Silverlight applicaiton. It uses WCF services to pass EF 4 Self Tracking Entities back and forth from client to server. Read methods are working fine to serve the Trackable entity collections to the Silverlight client from the WCF…
1
vote
1 answer

History in database using entity framework

I want to store history in my table. I have table Employee. Employee { [Id], [name], [phone], [isActive], [createdDate], [closedDate](default '23:59:59 9999-12-31'), [DepartmentId] References…
Konst Fom
  • 65
  • 7
1
vote
1 answer

Can I use Self Tracking Entities and DBContext in Entity Framework 4.1?

I want to know if DBContext (EF 4.1) supports Self Tracking Entities. If yes, how can I do that?
Baig
  • 1,489
  • 1
  • 25
  • 41
1
vote
1 answer

self-tracking-entities and lazy loading

Is there a way to use lazy loading and self-tracking-entities while the context is open? Will there be any issues and what do I have to consider? Thanks a lot for your aswer in advance.
yonexbat
  • 2,902
  • 2
  • 32
  • 43
1
vote
1 answer

Why TrackableCollection doesn't call the MarkAsDeleted method for removed item?

I have a problem when using the Self-Traking Entities in compination of the WPF. I have two entity set for exmaple: People and Numbers. Each person has many numbers and many numbers can have a person. Here the sample code which I expect a number…
Amir Karimi
  • 5,401
  • 4
  • 32
  • 51
1
vote
1 answer

Entity Framework - Disconnexted Behavior in nTier

I am new to EF but I will try my best to describe the scenario. I have 3 tables in My DB namely RecommendationTopic, Recommendation and Question. Each RecommendationTopic can have multiple Recommendations and each Recommendation may have multiple…
Vinod
  • 929
  • 1
  • 16
  • 42
1
vote
2 answers

EF4/WCF SaveChanges() Best Practice

This is how we implement a generic Save() service in WCF for our EF entities. A TT does the work for us. Even though we don't have any problems with it, I hate to assume this is the best approach (even if it might be). You guys seem pretty darn…
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
1
vote
1 answer

Self-Tracking Entities Clear collection

I have a STE and I want to clear navigation property collection like customer.Orders.Clear(). But Clear doesn't mark orders as Deleted so they won't be deleted on ApplyChanges call. Is there any built-in way to clear orders and mark all of the as…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
1
vote
1 answer

How to track entity changes with WCF Ria Services?

I need to log changes made to an entity that occur on the client to a database table. However, when I make changes and inspect the ChangeTracker property, it claims that no changes have occurred. [Service] private static readonly ISomeDao…
O.O
  • 11,077
  • 18
  • 94
  • 182
1
vote
1 answer

Problem with EF STE and Self-Referencing tables

This is my first post here, so I hope everything is fine. Here is my problem: I have a table in my database called UserTypes. It has: ID; IsPrivate; Parent_ID; The relevant ones are the first and the third one. I have another table called…
1
vote
2 answers

Getting the real State of SelfTracking Entities, including Navigation Properties

I would like to change the display of objects if they have unsaved changes. I thought I could just use ChangeTracker.State, but that doesn't change to Modified if I change a Navigation Property. For example, a Contact object contains Navigation…
Rachel
  • 130,264
  • 66
  • 304
  • 490
1
vote
2 answers

Can a class inherit from Entity Framework class and still persist back to the DB using the inherited classes mappings?

Can a class inherit from Entity Framework class and still persist back to the DB using the inherited classes mappings? I have received errors trying to derive from a 'Self-Tracking Entity' class when I try and SaveChanges stating that the Type does…
1
vote
1 answer

Working with Sets of Self-Tracking Entities causing performance issues

I saw this Post by ADO.Net team which looks very promising until I started using it in my application. I have EF 4.0 model with close to 100 self tracking entities. After including the iterator in my project, any of the extension methods…
1
vote
2 answers

How to handle POCO refresh in class library?

Created POCOs using Self-Tracking Entities template Copied .tt file with POCOs to class library Added new table to database Refreshed edmx file Now what? Do I really have to Add Code Generation Item and copy the generated POCOs to my class library…
O.O
  • 11,077
  • 18
  • 94
  • 182
1
vote
1 answer

EF4 STE Access to deleted entity

How can I access deleted entity in self tracking entities graph? I understand that in case I use MarkAsDeleted on the objects contained in a collection they are moved to ObjectsRemovedFromCollectionProperties of the parent entity, but how to access…
Jakub
  • 57
  • 5