lambda表达式返回“0” [英] lambda expression returning "0"

查看:96
本文介绍了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”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆