消除部分warning
This commit is contained in:
@@ -219,7 +219,7 @@ public static partial class Extensions
|
||||
/// </summary>
|
||||
private static bool? GetBool(this object data)
|
||||
{
|
||||
switch (data.ToString().Trim().ToLower())
|
||||
switch (data.ToString()?.Trim().ToLower())
|
||||
{
|
||||
case "0":
|
||||
return false;
|
||||
@@ -466,7 +466,7 @@ public static partial class Extensions
|
||||
{
|
||||
try
|
||||
{
|
||||
return obj == null ? string.Empty : obj.ToString();
|
||||
return obj == null ? string.Empty : obj.ToString()!;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -489,7 +489,7 @@ public static partial class Extensions
|
||||
return string.Join(",", list);
|
||||
}
|
||||
|
||||
return obj.ToString();
|
||||
return obj.ToString()!;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -678,7 +678,7 @@ public static partial class Extensions
|
||||
/// <returns></returns>
|
||||
public static string ObjToString(this object thisValue)
|
||||
{
|
||||
if (thisValue != null) return thisValue.ToString().Trim();
|
||||
if (thisValue != null) return thisValue.ToString()!.Trim();
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user