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
0
votes
1 answer

MS EntityFramework: how to split entity with inheritance?

I have table name Transaction in the DB. I want to have 2 subclasses TransactionA and TransactionB. I've made it as described here:…
mimic
  • 4,897
  • 7
  • 54
  • 93
0
votes
2 answers

Self Tracking Entities vs Pure POCO v. Future Proofing (3-tier)

This is obviously a topic that has been discussed many times, however my angle of approach here is a little different. As far as I understand, a STE is considered a POCO (it is not tied to the EF dll in any way), it just has some extra "stuff"…
0
votes
1 answer

entity framework, self-tracking entity and sqlserver file stream

I just start a project where I need to have a WCF services that read and write files. The architecture is based on DDD using Entity Framework Self-Tracking Entity. The simple GUI should show a grid with a list of file and then click the row you can…
Andrea
  • 803
  • 1
  • 12
  • 27
0
votes
2 answers

ASP.NET GridView with Self-Tracking Entities

My STEs work very well and track changes with individual controls like textboxes, memo etc. on the webform, except when used with asp.net gridview. With Gridview on Update it says allways "Added" as state of the STE. Has anyone a Solution for my…
0
votes
2 answers

how can i know when a self-tracking entity has been changed?

I have been working with the Entity Framework + Self-Tracking entities, and came out with a problem: Is there any way to determine when an entity has been changed?? For example: If you have an entity User with two fields: Name and Password, you can…
Ariel
  • 1,641
  • 1
  • 18
  • 27
0
votes
1 answer

Self-tracking entity Remove child entity

What is the right way to delete collection element from STE. Currently I use the following code: order.Items[i].MarkAsDeleted(); order.Items.RemoveAt(i); Looks like it works (and ApplyChanges removes entity in spite I have removed it from…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
0
votes
1 answer

DDD using STE vs POCO

Developing n-layered application with DDD (o better DDDD because we are using WCF) using Microsoft technology (where we have full controll of all component), the best choise seems to be STE vs POCO (this last one force the usage of DTOs). That's…
Andrea
  • 803
  • 1
  • 12
  • 27
0
votes
2 answers

Debugging Self Tracking Entities - AcceptChanges exception due to object's key values conflict with another object in the ObjectStateManager

I have an exception occurring when saving changes to a self tracking entity: AcceptChanges cannot continue because the object's key values conflict with another object in the ObjectStateManager. Make sure that the key values are unique before…
0
votes
1 answer

Validating a Self Tracking Entity (EF) through WCF

I'm having trouble defining what my OperationContract should be when adding / updating an entity. I want to send an entity (or list of entities) to the ObjectContext via the WCF Service (which will instantiate a Business Manager for me to do the…
0
votes
1 answer

Enable ChangeTracking In Child Objects Using STE

I'm using STE and I want to enable change tracking for an object and its children. What I currently have to do now is something like this. int id = 1; using(CustomerEntities context = new CustomerEntities()) { CustomerSection custSection =…
John Fischer
  • 1,115
  • 3
  • 13
  • 24
0
votes
1 answer

Entity Framework 4 POCO Self Tracking

Hi I am developing a project with EF 4. I am trying to implement POCO Self Tracking do I need to implement a wcf service? I am having issues with modifying the entities as the changes are not persisted to the db. Thanks in advance.
markpcasey
  • 559
  • 1
  • 10
  • 18
0
votes
2 answers

Entity Framework 4 InvalidOperationException While Inserting or Updating

I use SelfTracking entities, everything was working ok until we added some fields in a reference detail table. I can't get what is the problem with the reference foreign key! I haven't design the database schema but as I can see everything looks…
0
votes
3 answers

Send a linq query to server as an object

I have some linq query like this : from x in from dbcontext join y in dbcontext on x.id equals y.id select new {x,y} my problem is how I can send these kinds of query to server as an object here is my linq query is direct data-access I need to…
kamiar3001
  • 2,646
  • 4
  • 42
  • 78
0
votes
1 answer

EF 4.0 adding relationship

HI I have a project with uses EF self tracking objects.I am trying to add a relationship to an object . (parentobject.relationshipObject.Add(New relationshipObject...)). But it throws an error: Cannot change ObservableCollection during a…
user55474
  • 537
  • 1
  • 8
  • 25
0
votes
3 answers

EF 4.0 Self-Tracking Entities, intended updates are being translated into inserts

Let's assume that the below method lives in a WCF service. The UI retrieved an instance of the Status object, and makes a subsequent call to the service using this method. Instead of assigning the status to the user as I would expect, it attempts…