Creating LINQ to SQL Record Properties that Point to Foreign Key Fields?

I don't know about Linq to SQL, but Entity Framework has something called Navigation Properties which allow you to query associated entities for a given entity.

I don't know about Linq to SQL, but Entity Framework has something called Navigation Properties, which allow you to query associated entities for a given entity.

To answer your question, yes that is possible. The only caveat is that your partial value must be something that can translate to sql. You run into this problem in cases where you might have logic in your partial value that sql has no equivalent to.

It’s just a foreign key. Relationships aren’t items and don’t have any property (or “field” as they’re called in “M”). For example, the relationship between a student’s enrollment record and a given class can’t have, as property, the grade that the student got for that class (as in the example in section 4.1.4 of the second LC of SML).

To model this in “M” you need to create another item (e.g. “courseEnrollment”) and have a relationship from the student to that item and another one from that item to the “course” item itself. Or to replace the foreign key in the student table with a complex structure that contains both the foreign key and the properties of the relationship. At the end it has the same expressiveness potential, but in a less streamlined form.

I assume Microsoft took this approach for performance reasons.

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