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
2 answers

WCF Service with DataContracts VS Default Entity Framework Entities Object

What are the pros and cons of using WCF Service with DataContracts VS Entity Framework Entities Object? If i generate Data Contracts using ADO.net Self Tracking Entity Generator the classes in my data layer. What will the best way of using it in…
Shailender Singh
  • 987
  • 3
  • 14
  • 25
1
vote
1 answer

EF4 circular reference problem when deleting

Hi I am using EF 4 self tracking entities. I have three tables (Questionnaire, Section and Page) as follows; Questionnaire Id Title WhenClosedShowPageId Section Id QuestionnaireId Page Id SectionId So that in the EF model Questionnaire has…
Darren
  • 47
  • 5
1
vote
1 answer

Self-Tracking Entity Sets and comparing changes

Im making .net application as a project on my Univeristy and I have a problem with Self-Tracking Entity Sets. I'm selecting an record, passing it through a wcf service, make some changes and pass it to the server again. There I want to compare what…
Pax0r
  • 2,324
  • 2
  • 31
  • 49
1
vote
2 answers

Entity Framework - Self Tracking Entities

If using STE's with entity framework, when building the client application (say web site) which will receive the entities via wcf, is it necessary to reference the model dll assembly (which contains the definitions of the classes?) to achieve all…
David
  • 3,047
  • 4
  • 45
  • 79
1
vote
0 answers

How to reuse self tracking entities?

Among countless problems with STEs I am now facing this one, which should be trivial, but is not: For simplicity, lets assume a standard invoice, order, product scenario. Lets say that I have a non-stateless (for whatever reason) tier that receives…
Holstebroe
  • 4,993
  • 4
  • 29
  • 45
1
vote
1 answer

Insert Data into mulitple table using FK's using Entity framework

Movie - ID, Name, Description, DirectorID-Fk, MusicID-Fk Director - ID, Name Music - ID, MusicName Now I am trying to insert a new record to movie but I dont know whether Director is already existing in the DB and same with the Music). From UI i…
Praneeth
  • 2,527
  • 5
  • 30
  • 47
1
vote
1 answer

Self-tracking entities Silverlight proxy generation

I’m developing a Silverlight 4 application using STE with EF4. I created a Silverlight project with all the Entity classes generated with my STE T4 template and build properly on VS. But when I add a WCF proxy with Visual Studio and check the “Reuse…
1
vote
0 answers

How to work with secondary keys in self tracking entities?

I am trying to establish a good practice for working with secondary keys when using self tracking entities and entity framework 4, but there seems to be a lot of pitfalls. Lets say I have an Alarm entity, that can have ConfirmingUser navigational…
Holstebroe
  • 4,993
  • 4
  • 29
  • 45
1
vote
0 answers

Entity Framework filter nav property with Self Tracking Entities

I'm using Self Tracking Entities and have a scenario where I have an entity that represents a table that we'll call table A. A is a parent to another table B which is also represented as an entity. On my WinForm I have 3 different binding sources…
1
vote
2 answers

With entity framework's self tracking entities, can I perform an explicit load?

I wish to return a graph for a "Business" entity. The Buiness entity has a collection of "Contacts". So I basically want this: ctx.Business.Include("Contacts").Where(b => b.BusinessID == id).Single(); The problem is I don't want ALL the contacts…
1
vote
0 answers

EF4 STE's and MVC2 - ChangeTracker not POSTing

I'm trying to set up an MVC2 app with Entity Framework Self-Tracking-Entities. My view is a strongly-typed view of the entity type generated by the STE T4 template. Here's my GET: public ActionResult Edit(int id) { var ri = new…
1
vote
1 answer

Self-tracking entities extension methods

When the context is generated i see there are some extension methods : AcceptChanges, MarkAsAdded, MarkAsDeleted, MarkAsModified. When should i use these methods since they are available only on the service?
boo
  • 183
  • 1
  • 10
1
vote
2 answers

Self Tracking Entities versus timestamp column in database

In an optimistic concurrency scenario fo a web-app, I am considering to give each table the timestamp column (sqlserver), comparable to a guid. Linq to entities will then generate sql update queries like WHERE id = @p0 AND timestamp = @p1 when one…
Gerard
  • 13,023
  • 14
  • 72
  • 125
1
vote
2 answers

Entity Framework 4.0 - Can I send a complex type to the client over WCF?

Hey, can anybody confirm the following scenario will work: I am developing a 3-tier application in .NET 4.0: Winforms Client, aspx server and SQL 2008 database. The server communicates with the SQL 2008 database by means of Entity Framework 4.0,…
1
vote
2 answers

Self Tracking Entities with Pre-Generated Views

I am currently using the Self Tracking entities of the .NET Entity Framework, however I would like to speed up my execution of queries. The first thing everyone seems to suggest is generate the views for the model at compile time. Using the ssdl…
James
  • 2,458
  • 3
  • 26
  • 50