This commit is contained in:
he
2024-09-26 15:03:01 +08:00
parent ea48967492
commit 3d6d64175b
5 changed files with 70 additions and 9 deletions
@@ -50,5 +50,25 @@ namespace IRaCIS.Core.Infrastructure.Extention
}
}
/// <summary>
/// 查询字符串 为null 返回指定字符
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="source"></param>
/// <returns></returns>
public static string FirstIsNullReturnValue(this IEnumerable<string> source,string value)
{
var result = source.FirstOrDefault();
if (result == null || result == string.Empty)
{
return value;
}
else
{
return result;
}
}
}
}