From 457680f77f1e62539a5bc6aeeccffbcff69ef6db Mon Sep 17 00:00:00 2001 From: DawenYang Date: Wed, 29 May 2019 17:00:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=ADlist=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E6=95=B0=E6=8D=AE=EF=BC=8C=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=BD=BF=E7=94=A8list.Any()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c#/AboutList.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 c#/AboutList.cs diff --git a/c#/AboutList.cs b/c#/AboutList.cs new file mode 100644 index 0000000..ecc8f1d --- /dev/null +++ b/c#/AboutList.cs @@ -0,0 +1,21 @@ + +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Fawvw.HR.Platform.Api.Controllers +{ + public class AboutList + { + /// + /// 判断list是否为空 + /// + public void ChargeList() + { + var list = new List();//正常是请求一个service返回一个list + if (list != null && list.Count > 0) //直接使用list.Any()即可 + { + //继续下面的代码逻辑处理…… + } + } + } +} \ No newline at end of file -- Gitee