Setting SQL Relationships For LINQ Queries

Posted by Soo on Stack Overflow See other posts from Stack Overflow or by Soo
Published on 2010-05-11T14:32:32Z Indexed on 2010/05/11 14:54 UTC
Read the original article Hit count: 336

Filed under:
|
|

I have two tables that I'm trying to create a relationship between so I can write nice LINQ queries that don't require join.

Widgets
WidgetId
WidgetDescription

Orders
OrderId
WidgetId
OrderDate

What I want to be able to do is create a LINQ query that does something similar to:

var result = from x in db.Widgets
Where x.Orders.OrderDate == "5/11/2010"
select x;

I can't seem to get intellitext to pick up the other database despite creating a relationship in SQL server. Are there any additional steps I need to take to make this work?

© Stack Overflow or respective owner

Related posts about sql

Related posts about LINQ