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