Review changes
This commit is contained in:
parent
1027792b16
commit
7e6a45c402
|
@ -97,12 +97,12 @@ namespace Emby.Server.Implementations.Data
|
|||
DateTimeStyles.None).ToUniversalTime();
|
||||
}
|
||||
|
||||
public static bool TryReadDateTime(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out DateTime? result)
|
||||
public static bool TryReadDateTime(this IReadOnlyList<IResultSetValue> reader, int index, out DateTime result)
|
||||
{
|
||||
result = null;
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
{
|
||||
result = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -114,15 +114,16 @@ namespace Emby.Server.Implementations.Data
|
|||
return true;
|
||||
}
|
||||
|
||||
result = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool TryGetGuid(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out Guid? result)
|
||||
public static bool TryGetGuid(this IReadOnlyList<IResultSetValue> reader, int index, out Guid result)
|
||||
{
|
||||
result = null;
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
{
|
||||
result = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -158,7 +159,7 @@ namespace Emby.Server.Implementations.Data
|
|||
return result[index].ToBool();
|
||||
}
|
||||
|
||||
public static bool TryGetBoolean(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out bool result)
|
||||
public static bool TryGetBoolean(this IReadOnlyList<IResultSetValue> reader, int index, out bool result)
|
||||
{
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
|
@ -171,7 +172,7 @@ namespace Emby.Server.Implementations.Data
|
|||
return true;
|
||||
}
|
||||
|
||||
public static bool TryGetInt32(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out int result)
|
||||
public static bool TryGetInt32(this IReadOnlyList<IResultSetValue> reader, int index, out int result)
|
||||
{
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
|
@ -189,7 +190,7 @@ namespace Emby.Server.Implementations.Data
|
|||
return result[index].ToInt64();
|
||||
}
|
||||
|
||||
public static bool TryGetInt64(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out long result)
|
||||
public static bool TryGetInt64(this IReadOnlyList<IResultSetValue> reader, int index, out long result)
|
||||
{
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
|
@ -202,7 +203,7 @@ namespace Emby.Server.Implementations.Data
|
|||
return true;
|
||||
}
|
||||
|
||||
public static bool TryGetSingle(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out float result)
|
||||
public static bool TryGetSingle(this IReadOnlyList<IResultSetValue> reader, int index, out float result)
|
||||
{
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
|
@ -215,7 +216,7 @@ namespace Emby.Server.Implementations.Data
|
|||
return true;
|
||||
}
|
||||
|
||||
public static bool TryGetDouble(this IReadOnlyList<IResultSetValue> reader, int index, [NotNullWhen(true)] out double result)
|
||||
public static bool TryGetDouble(this IReadOnlyList<IResultSetValue> reader, int index, out double result)
|
||||
{
|
||||
var item = reader[index];
|
||||
if (item.IsDbNull())
|
||||
|
|
Loading…
Reference in New Issue
Block a user