Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET MVC3
Hi Guys,
 
I am doing MVC Coding and using LLBLGEN Pro 3.5 version with it. I am using repository pattern and kind of need some guidance:
 
I have this code which returns me an IEnumerable(of T)
 
_repositoryExtMailCost.FindByCondition(Function(x) x.EndDate Is Nothing Or x.EndDate >= DateTime.Now)
 
The result contains a foreign key that i need to use to filter the results on the other table like this
 
_repositoryExtMailItem.FindByCondition(Function(x) x.ID ----)
 
this findbycondition is a custom function and takes a func(of t, boolean). now i want to use the result (foreign key) returned in the first statement and then apply that in the last statement but i am not sure how can i do that? Can you guys help?
 
Is there something similar to Entity Framework or LINQ To SQL like i can use Table joins and then say this foreign key is primary key of the other table and so give me all the results where primary key is in the list?
 
Thanks Guys.
Posted 10-Oct-12 23:49pm
Edited 11-Oct-12 18:15pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You need some reading on how to use joins using LINQ for that you may go up with this.
 
Additional links:
 
Linq to SQL Tutorial[^]
 
Linq to Entities[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 15 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100