修改一版

This commit is contained in:
he
2022-08-31 16:05:41 +08:00
parent b38239b926
commit ac998e8e73
3 changed files with 124 additions and 62 deletions
@@ -3,6 +3,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using System.Linq.Dynamic.Core;
using System.Collections.Generic;
namespace IRaCIS.Core.Infrastructure.Extention
{
@@ -29,6 +30,25 @@ namespace IRaCIS.Core.Infrastructure.Extention
}
}
/// <summary>
/// 查询字符串 为null 返回string.Empty
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="source"></param>
/// <returns></returns>
public static string FirstIsNullReturnEmpty(this IEnumerable<string> source)
{
var result = source.FirstOrDefault();
if (result == null || result == string.Empty)
{
return string.Empty;
}
else
{
return result;
}
}
}
}