mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Review changes
This commit is contained in:
parent
1027792b16
commit
7e6a45c402
@ -97,12 +97,12 @@ namespace Emby.Server.Implementations.Data
|
|||||||
DateTimeStyles.None).ToUniversalTime();
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
{
|
{
|
||||||
|
result = default;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,15 +114,16 @@ namespace Emby.Server.Implementations.Data
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = default;
|
||||||
return false;
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
{
|
{
|
||||||
|
result = default;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +159,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
return result[index].ToBool();
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
@ -171,7 +172,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
return true;
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
@ -189,7 +190,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
return result[index].ToInt64();
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
@ -202,7 +203,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
return true;
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
@ -215,7 +216,7 @@ namespace Emby.Server.Implementations.Data
|
|||||||
return true;
|
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];
|
var item = reader[index];
|
||||||
if (item.IsDbNull())
|
if (item.IsDbNull())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user