Is there a DataContext in LINQ-to-Entities (NOT Linq-to-SQL)?

LINQ to Entities uses ObjectContext, not DataContext Here is a short description of EF: LINQ to Entities, the ObjectContext Class, and the Entity Data Model LINQ to Entities queries use the Object Services infrastructure The ObjectContext class is the primary class for interacting with an EDM as CLR objects. The developer constructs an ObjectQuery instance through the ObjectContext. The generic ObjectQuery class represents a query that returns an instance or collection of typed entities.

Entity objects returned by ObjectQuery are tracked by the Object Context and can be updated by using the SaveChanges method It doesn't even work the same way as the DataContext in LINQ to SQL. While it is true that they both manage the connection and track changes, yet they differ in how they model the data structures and relationships I would give the poster of that wrong answer some slack, though, because LINQ to SQL does make reference to "entities", and someone not familiar with EF could very well still be thinking they know what you are talking about For example: LINQ to SQL and the DataContext Class The DataContext is the source of all entities mapped over a database connection. It tracks changes that you made to all retrieved entities and maintains an "identity cache" that guarantees that entities retrieved more than one time are represented by using the same object instance It can be confusing.

LINQ to Entities uses ObjectContext, not DataContext. Here is a short description of EF: LINQ to Entities, the ObjectContext Class, and the Entity Data Model LINQ to Entities queries use the Object Services infrastructure. The ObjectContext class is the primary class for interacting with an EDM as CLR objects.

The developer constructs an ObjectQuery instance through the ObjectContext. The generic ObjectQuery class represents a query that returns an instance or collection of typed entities. Entity objects returned by ObjectQuery are tracked by the Object Context and can be updated by using the SaveChanges method.It doesn't even work the same way as the DataContext in LINQ to SQL.

While it is true that they both manage the connection and track changes, yet they differ in how they model the data structures and relationships. I would give the poster of that wrong answer some slack, though, because LINQ to SQL does make reference to "entities", and someone not familiar with EF could very well still be thinking they know what you are talking about. For example: LINQ to SQL and the DataContext Class The DataContext is the source of all entities mapped over a database connection.

It tracks changes that you made to all retrieved entities and maintains an "identity cache" that guarantees that entities retrieved more than one time are represented by using the same object instance. It can be confusing.

Apparently, LinqToEntities uses an ObjectContext instead of DataContext. It is hilarious that the object team made a DataContext and the data team made an ObjectContext (and on to DataQuery vs ObjectQuery, etc. ) "Naming is Hard!" Update, for .

Net 4 with EF4.1, you might also be interested in DbContext when working with LinqToEntities. See also.

I think you might be referring to the ADO. NET Entity Data Model (.edmx file - comparable to a . Dbml file).

In VS it is seen in the Add Item->ADO. NET Entity Data Model.

There are a lot of these arbitary syntax differences. E.g. SubmitChanges (L2S) and SaveChanges (L2E).

However, that would be just the tip of the differences between the two technologies.

LINQ to Entities uses ObjectContext, not DataContext. LINQ to Entities queries use the Object Services infrastructure. An instance or collection of typed entities.

The SaveChanges method. It doesn't even work the same way as the DataContext in LINQ to SQL. While it is true that they both manage the connection and track changes, yet they differ in how they model the data structures and relationships.

I would give the poster of that wrong answer some slack, though, because LINQ to SQL does make reference to "entities", and someone not familiar with EF could very well still be thinking they know what you are talking about. More than one time are represented by using the same object instance. It can be confusing.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions