RichC
RichC

Reputation: 7879

Entity Framework - associated entities question

I've noticed that if i have an Pk/FK association, the FK ID is removed from the entity in the designer. How do I join query statements?

Basically I'm looking for some good Linq to Entity video tutorials (sorry, I'm an audio/visual learner)

Upvotes: 0

Views: 645

Answers (1)

naspinski
naspinski

Reputation: 34717

Say you have a 'review' item, and it is related to a 'product' you would do something like this:

review.productsReference.Value = db.products.First(p => p.product_id == 2);

Setting the reference.Value equal to the object itself.

http://naspinski.net/post/Getting-started-with-Linq-To-Entities.aspx

Upvotes: 1

Related Questions