What does it actually mean by the term "Entity" in LINQ?
What is the difference between EntitySet and EntityRef when talking about LINQ?
Can you give a real-world example? Like Order and OrderItems, etc?
What does it actually mean by the term "Entity" in LINQ?
What is the difference between EntitySet and EntityRef when talking about LINQ?
Can you give a real-world example? Like Order and OrderItems, etc?
In the context of Linq-to-SQL, an Entity basically just means an object that can be stored in the database. Note that the term is sometimes used more narrowly, e.g. in Domain Driven Design.
An EntitySet represents an object's relation to a set of other objects, whereas an EntityRef represents a relation to a single other object. In other words, if you have a many-to-one relationship between two classes of objects, one end will be represented by an EntitySet, and the other by an EntityRef.