我正在使用Entity Framework 6和vb.net2017。当我需要逐步创建查询时,有2种情况:
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
和
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
我的问题是:在每种情况下如何声明查询:
Dim query as IEnumerable(of myobj1)
或
Dim query as IQueryable(of myobj1)
答案 0 :(得分:0)
IQueryable(myobj1的)。例如,Include(...)方法是基于IQueryable实现的。
IQueryable是IEnumerable的扩展
p = figure(title="Cluster Activity",
plot_width=1200,
plot_height=700,
toolbar_location=None)
without = p.square(name="without", ##your filtered data source without names)
with = p.square(name="with", ##your filtered data source with names)
hoverwith = HoverTool(names=["with"],tooltips=TOOLTIPS = [
("Usage", "@{usage}%"),
("Name", "@name"),
("PID", "@pid"),
("Command", "@command"),
("User", "@user"),
])
hoverwithout = HoverTool(names=["without"],tooltips=TOOLTIPS = [
("Usage", "@{usage}%"),
("PID", "@pid"),
("Command", "@command"),
("User", "@user"),
])
p.add_tools(hoverwith, hoverwithout)