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

EF 4 Self-Tracking Entities Generator Error Template Does Not Contain Defenition for NeedsHandleCascadeDeleteMethod

When trying to generate self-tracking entities using Visual Studio 2010 I am getting the following error: Compiling transformation: 'Microsoft.VisualStudio.TextTemplatingFD3088D2F02A7E80E5DF5FEC4C1DAB39.GeneratedTextTransformation.MetadataTools' …
Andrew
  • 165
  • 1
  • 6
2
votes
1 answer

Can an entity be unloaded from entity framework's ObjectStateManager?

I am using Entity Framework with Self-Tracking Entities over WCF. I have 2 entities, Customer and PriceMatrix with a many-to-many relationship (the customer can have many historic price matrices, and a matrix can be shared between a group of…
Darren
  • 4,408
  • 4
  • 39
  • 57
2
votes
1 answer

Entity Framework not changing EnityState on Update

I have a working Update method , which is simply changing a property value and calls SaveChanges() on db context: public void Update(int id, string name) { var entity = context.Entities.Single(x => x.Id == id); entity.Name = name; …
Ruslan
  • 9,927
  • 15
  • 55
  • 89
2
votes
2 answers

Self Tracking Entities - Deleting from Navigation Property does not set state to 'Deleted'

In the constructor of each of my POCO's I have this: this.StartTracking(); To ensure that tracking is turned on for every instance of one of my POCO's. I have an Entity A which contains a TrackableCollection of Entity B. When I load my instance of…
Brandon
  • 10,744
  • 18
  • 64
  • 97
2
votes
0 answers

Tracking changes to an entity framework object graph over multiple postbacks

We have an ASP.Net application in which the user is (in several places) allowed to make changes to an object graph over multiple postbacks, and then apply those changes when the user clicks save. For example imagine a filter with many conditions…
Justin
  • 84,773
  • 49
  • 224
  • 367
2
votes
1 answer

Migrating from Self-Tracking Entities to DBContext

I've read that Self-Tracking Entities (STE) are now deprecated and Microsoft will not invest in those anymore. I am currently working on a n-tier application in which client code is making method calls to a WCF Service to fetch Self-Tracking…
user1956068
2
votes
1 answer

Self Tracking Entities SaveChanges() Exception when add entity in many to many relation

I have 2 entity objects "Persons" and "Seminar". Relationship - many to many. A project consist of - EF4.0/STE, WCF and WinForms. When i try Add Persons To Seminar public void AddPersonsToSeminar(Seminar seminar, List persons) { …
2
votes
1 answer

How to use AutoMapper with Post Action

in my solution I have an ASP.NET MVC3 project, and a WCF project that works with a database. I use entity framework self tracking and AutoMapper to map objects. My question is: how i can use AutoMapper with Post Action like crate and delete and Edit…
Tarek Saied
  • 6,482
  • 20
  • 67
  • 111
2
votes
3 answers

Entity Framework, WCF, Clients, and Object Context questions

Application purpose: The application I am creating will be responsible for many processes, but I am currently building a price feeder, a way to save these prices, and functionality to send these prices to a client application (as a proof of…
1
vote
1 answer

Editing a datagridview on a windows forms from behind a WCF layer using Entity Framework 4.0

I am using self-tracking entities from across a WCF Layer to bind a datagridview on a Windows forms application. All working fine. My problem is that when I am editing a cell, the moment I move out (cellendedit) the row shows clean. There is this…
1
vote
0 answers

Entity Framework Self Tracking Entities - error calling StartTracking

I am using Self Tracking Entities with the Entity Framework and for some reason I am now getting an error when making a call to StartTracking() before I make changes to an entity. My code is as follows: BusinessUnit BusinessUnitObject =…
eyeballpaul
  • 1,725
  • 2
  • 25
  • 39
1
vote
1 answer

Entity Framework Self Tracking Entities - Synchronize between 2 databases

I am using Self Tracking Entities with the Entity Framework 4. I have 2 databases, with the exact same schema. However, tables in one database will be added to/edited etc (and I mean data will be added/edited, not the actual table definitions) and…
eyeballpaul
  • 1,725
  • 2
  • 25
  • 39
1
vote
1 answer

STE as Data Contract?

Is there any way to share self tracking entities with client tier(from server tier which is WCF) like Data Contract. I mean, do not include any assembly with STE to client, just get them from server e.g. If "DAL" is the service reference, I want…
ard
  • 13
  • 2
1
vote
1 answer

Entity Framework multiple data models

I have projection using EF 4.0 with self tracking entities it has one data model and everything is working fine. No I need to add a second model to to connect to a different database. As soon as I add the second model into the project the build…
Satish
  • 3,020
  • 7
  • 35
  • 47
1
vote
1 answer

How to handle Self-Tracking Entities InvalidOperationException

STEs throw two types of Exception: UpdateException InvalidOperationException With UpdateException we can check the inner SQLExeption.Number to identify the the Exception (ex. 515=NullNotAllowed) InvalidOperationException seems not to expose a…
Peter Meinl
  • 2,566
  • 25
  • 39