任何()v s count()为null [英] Any() v s count() with null
问题描述
var lstRoadmaps =来自路线图的SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()
选择路线图;
if(lstRoadmaps.Any()&& lstRoadmaps!= null)
{//
}
------ --------------------------
var lstRoadmaps =来自SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()中的路线图br />
选择路线图;
if(lstRoadmaps.Count()&& lstRoadmaps!= null)
{//
}
--------------------------------- ---------------------
Q1-功能明智的上述两者之间的区别是什么。
_______________________________________________________________________________________________________
var lstRoadmaps =来自路线图的SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()
选择路线图;
if(lstRoadmaps.Any( )&& lstRoadmaps!= null)
{//
}
------------------- -------------
var lstRoadmaps =来自SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()中的路线图
选择路线图;
if(lstRoadmaps.Count()&& lstRoadmaps!= null)
{//
}
---------------------------------------------- --------
Q2 lstRoadmaps!= null是必须检查或任何()&count()足以处理null
请非常紧急。
var lstRoadmaps = from roadmap in SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()
select roadmap;
if (lstRoadmaps.Any()&& lstRoadmaps!=null)
{//
}
--------------------------------
var lstRoadmaps = from roadmap in SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()
select roadmap;
if (lstRoadmaps.Count()&& lstRoadmaps!=null)
{//
}
------------------------------------------------------
Q1 -what is the difference between the above two in functioanlity wise.
_______________________________________________________________________________________________________
var lstRoadmaps = from roadmap in SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()
select roadmap;
if (lstRoadmaps.Any()&& lstRoadmaps!=null)
{//
}
--------------------------------
var lstRoadmaps = from roadmap in SessionManager.Current.ProcessComplianceQueryFactory.GetAllRoadmaps()
select roadmap;
if (lstRoadmaps.Count()&& lstRoadmaps!=null)
{//
}
------------------------------------------------------
Q2 lstRoadmaps!=null is necessary to check or any() & count() is enough to handle null
it is very urgent please.
推荐答案
我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。
亲自尝试,你可能会发现它不是和你想的一样困难!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
这篇关于任何()v s count()为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!