Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello !

I'm using 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 Ascending
                 Select t
     If condition1 then
         list1 = list1.Where(Function(t2) = 1)
     End If
     If condition2 then
         list1 = list1.Where(Function(t2) = 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]( "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: 3,582 times

last updated: 02 Feb '15, 05:04