在方法体内使用数组

方式一:

serviceBillList = serviceBillList.Where(b => new int[]{ 1,2,3}.Contains(b.Status));

方式二:

if (!new int[] { 1, 2, 3 }.Contains(item.Status))
 {
   model.Status = "fail";
   model.Message = "提交状态参数错误。";
   return model;
 }

 

posted @ 2019-07-23 11:48  James·wang  阅读(149)  评论(0编辑  收藏  举报