on 2015 Jan 31 5:03 PM
Hello !
I'm using VB.net and entity Framework. I have situation where depending on several conditions I construct a query step by step .
This is the code :(Article has 2 relationship with F1 and F2)
Dim list1 As IEnumerable(Of Article)
list1 = From t In context.Articles.Include("F1").Include("F2") Order By t.name Ascending
Select t
If condition1 then
list1 = list1.Where(Function(t2) t2.tp = 1)
End If
If condition2 then
list1 = list1.Where(Function(t2) t2.id = 7)
End If
Myreport.datasource=list1.ToList()
This code is working , but now I want to add a new condition , and if this is true the child "F1" should be filtered.
How can I filter the Child "F1"
Thank you !
User | Count |
---|---|
67 | |
11 | |
10 | |
10 | |
9 | |
8 | |
6 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.