19 lines
525 B
C#
19 lines
525 B
C#
using System.Data;
|
|
using System.Data.SQLite;
|
|
|
|
namespace Screenie.Util;
|
|
|
|
internal static class SQLiteDataReaderExt {
|
|
internal static T? GetNullableFieldValue<T>(this SQLiteDataReader reader, int index) {
|
|
return reader.IsDBNull(index)
|
|
? default
|
|
: reader.GetFieldValue<T>(index);
|
|
}
|
|
|
|
internal static T? GetNullableFieldValue<T>(this SQLiteDataReader reader, string name) {
|
|
return reader.IsDBNull(name)
|
|
? default
|
|
: reader.GetFieldValue<T>(name);
|
|
}
|
|
}
|