I'm using Entity Framework 6 and vb.net 2017. I have 2 cases when I need to create a query step by step :
query = (From t in context.myobj1s select t)
if (condition1) then
query = query.where(Function(t2) t2.value1 < 5)
If (condition2) then
query = query.where(Function(t2) t2.value2 > 120)
query.tolist
and
query = (From t in context.myobj1s.Local select t)
if (condition1) then
query = query.where(Function(t2) t2.value1 < 5)
If (condition2) then
query = query.where(Function(t2) t2.value2 > 120)
Mybindingsource.Datasource = query.tolist
My question is: how should I declare query in each situation:
Dim query as IEnumerable(of myobj1)
or
Dim query as IQueryable(of myobj1)