我有以下几点:
Dim Pols As Model.Batches.Renewals.YYYYY() = RenewAnaFindToYYYY(BegDate, EndDate, BegDate2, EndDate2, True)
Pols = Pols.Where(Function(x) x.PolicyId = 1440728).ToArray()
Run Code Online (Sandbox Code Playgroud)
现在如何测试 PolicyID 的列表?我想在数组中包含 PolicyID 的 {1425427, 1440728, 1695324}。我该怎么做呢 ?非常感激任何的帮助。
杰森
Contains在您的查询中声明某些集合中的 id 并使用扩展方法,如下所示:
Dim ids= New Integer(){1425427, 1440728, 1695324};
Pols = Pols.Where(Function(x) ids.Contains(x.PolicyId)).ToArray()
Run Code Online (Sandbox Code Playgroud)