0

I have used a variable called as "Filter" filter will be having inner join with other table. for example

Filter = "inner join tb1 on tbl1 = vCatalogItemsDetails"

My main query is

var result = context.vCatalogItemsDetails
.Where(whereClause) // whereClause will have all where conditions
.OrderBy("itemID descending select context.vCatalogItemsDetails")
.Skip((pageN - 1) * 10).Take(10);

how can i use the variable "Filter" in the above query so that i can get inner join ?

Kartikeya Khosla
  • 18,743
  • 8
  • 43
  • 69
  • 1
    I see no indication here that you have attempted this and are struggling. Did you try looking this up? http://msdn.microsoft.com/en-gb/library/bb311040.aspx – Ant P Aug 02 '14 at 12:40
  • http://stackoverflow.com/questions/2098041/linq-join-with-filter-criteria – sakir Aug 02 '14 at 12:44
  • you must use filter in where clause – sakir Aug 02 '14 at 12:44

1 Answers1

1

Your filter shouldn't join tables.

You should join your tables (to minimal joined size) and use Where conditions on the result. Linq should optimize it for you.

The Where conditions may have several 'And' expressions in it: LINQ Where with AND OR condition

Community
  • 1
  • 1
Pieter21
  • 1,765
  • 1
  • 10
  • 22