mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 10:07:10 +00:00
31 lines
No EOL
647 B
C#
31 lines
No EOL
647 B
C#
using System;
|
|
using Marr.Data.Converters;
|
|
using Marr.Data.Mapping;
|
|
|
|
namespace NzbDrone.Core.Datastore.Converters
|
|
{
|
|
public class Int32Converter : IConverter
|
|
{
|
|
public object FromDB(ColumnMap map, object dbValue)
|
|
{
|
|
if (dbValue == DBNull.Value)
|
|
{
|
|
return DBNull.Value;
|
|
}
|
|
|
|
if (dbValue is Int32)
|
|
{
|
|
return dbValue;
|
|
}
|
|
|
|
return Convert.ToInt32(dbValue);
|
|
}
|
|
|
|
public object ToDB(object clrValue)
|
|
{
|
|
return clrValue;
|
|
}
|
|
|
|
public Type DbType { get; private set; }
|
|
}
|
|
} |