我有一个带有可查询表达式的方法。是否可以在不同的函数中重用该函数,传入一个可查询的?
public static IQueryable<IProduct> Product(IQueryable<IProduct> dbSet)
{
var result = ProductLite(dbSet)
.Include(prd => prd.GraphicItems)
.ThenInclude(itm => itm.Graphic)
.ThenInclude(gfx => gfx.Items)
.Include(prd => prd.GraphicItems)
.ThenInclude(gfx => gfx.Culture)
.ThenInclude(cult => cult.Items)
.Include(prd => prd.Feedback)
.ThenInclude(item => item.Culture)
.Include(prd => prd.Feedback)
.ThenInclude(feed => feed.Customer)
.ThenInclude(cust => cust.Culture)
.Include(prd => prd.Feedback)
.ThenInclude(feed => feed.Votes)
.ThenInclude(vote => vote.Customer)
.Include(prd => prd.Stock)
.Include(prd => prd.Campaigns)
.ThenInclude(camp => camp.Campaign)
.Include(prd => prd.Campaigns)
.ThenInclude(camp => camp.Culture)
.ThenInclude(cult => cult.Items)
.ThenInclude(itm => itm.Culture)
.Include(prd => prd.SubscriptionItems)
.ThenInclude(sub => sub.Culture)
.Include(prd => prd.Links)
.Include(prd => prd.Meta);
return result;
}
我需要重用Product函数的函数:
public static IQueryable<IStore> Store(IQueryable<IStore> dbSet)
{
var result = StoreLite(dbSet)
.Include(str => str.Categorys)
.ThenInclude(cat => cat.Products)
}