首先我们来读取region的list
list<Region>region= entities.Region.where(p=>p.Isdeleted=="0")
下面我
们可以对它进行聚合函数操作:
int regioncount=0;
int.TryParse(region.Sum(obj => obj.RegionLevel=="country").ToString(),out regioncount)
ScriptManager.RegisterStartupScript(Page,GetType(),"Msg","alert('"+regioncount+"'); ",true);
输出结果:1032
原文链接:https://www.f2er.com/javaschema/287186.html