You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
647 B
31 lines
647 B
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; }
|
|
}
|
|
} |