修改一版
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user