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

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 !

asked 31 Jan '15, 17:03

george123's gravatar image

accept rate: 0%

This seems to be basically an EF question. Is that question related to SQL Anywhere (except the fact that one can use EF with SQL Anywhere)?

(02 Feb '15, 05:04) Volker Barth
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 31 Jan '15, 17:03

question was seen: 1,924 times

last updated: 02 Feb '15, 05:04