在方法体内使用数组

方式一:

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;
 }

猜你喜欢

转载自www.cnblogs.com/firstcsharp/p/11230911.html
今日推荐