lambda表达式返回“0”

编程入门 行业动态 更新时间:2024-10-20 03:33:21
本文介绍了lambda表达式返回“0”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

实际上我根据Country_ID获得了30条记录,但是在进入这条线之后它会给出0值,请你帮我这个 ObjNotificationDetails = ObjNotificationDetails.Where (a => a.Country_Id == objNotificationBO.Country_Id)。ToList(); 这是程序参数 @Subject = '', @ApplicationId = 0, @CountryId = 12, @UserId = 0, @StartDate = null, @EndDate = null, @IsActive = true 这里我剪我的代码也是 ObjNotificationDetails = NotificationDL.FetchNotificationDetails(objNotificationBO); ObjNotificationDetails = ObjNotificationDetails.Where(a => a.IsActive = = objNotificationBO.IsActive)。ToList(); if(objNotificationBO.Country_Id!= 0) { ObjNotificationDetails = ObjNotificationDet ails.Where(a => a.Country_Id == objNotificationBO.Country_Id)。ToList(); }

Actually im getting 30 records based on Country_ID but after going to this line it is giving 0 value could you please help me on this ObjNotificationDetails = ObjNotificationDetails.Where(a => a.Country_Id == objNotificationBO.Country_Id).ToList(); this is procedure parameters @Subject = '', @ApplicationId = 0, @CountryId = 12, @UserId = 0, @StartDate = null, @EndDate = null, @IsActive = true and here im shearing my code also ObjNotificationDetails = NotificationDL.FetchNotificationDetails(objNotificationBO); ObjNotificationDetails = ObjNotificationDetails.Where(a => a.IsActive == objNotificationBO.IsActive).ToList(); if (objNotificationBO.Country_Id != 0) { ObjNotificationDetails = ObjNotificationDetails.Where(a => a.Country_Id == objNotificationBO.Country_Id).ToList(); }

推荐答案

试试这个 Try this ObjNotificationDetails = ObjNotificationDetails.Where(a => a.IsActive.ToString() == objNotificationBO.IsActive.ToString()).ToList();

更多推荐

lambda表达式返回“0”

本文发布于:2023-11-08 07:36:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568748.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表达式   lambda

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!