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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.