JS中使用LINQ
详细使用方法可找相关资料
引用:
<script type="text/javascript" src="@Url.Content("~/Plugins/ResidentArea/Scripts/linq-vsdoc.js")" charset="UTF-8"></script> <script type="text/javascript" src="@Url.Content("~/Plugins/ResidentArea/Scripts/linq.js")" charset="UTF-8"></script> <script type="text/javascript" src="@Url.Content("~/Plugins/ResidentArea/Scripts/linq.min.js")" charset="UTF-8"></script>
使用示例:
var enumerableResultList = Enumerable.From(resultList); //resultList为集合 var length = enumerableResultList.Where("$.KEYWORD== 'XXX'").ToArray().length; var sumCount = enumerableResultList.Sum("$.KEYWORD");