removed UTC conversion, now being done by DB.

This commit is contained in:
kay.one 2013-05-22 22:33:12 -07:00
parent c357d062d3
commit be81f772df
3 changed files with 0 additions and 42 deletions

View File

@ -1,40 +0,0 @@
using System;
using System.Globalization;
using Marr.Data.Converters;
using Marr.Data.Mapping;
namespace NzbDrone.Core.Datastore.Converters
{
public class UtcDateTimeConverter : IConverter
{
public Type DbType
{
get
{
return typeof(DateTime);
}
}
public object FromDB(ColumnMap map, object dbValue)
{
if (dbValue != null && dbValue != DBNull.Value)
{
var dateTime = (DateTime)dbValue;
dateTime = new DateTime(dateTime.Ticks, DateTimeKind.Local);
return dateTime.ToUniversalTime();
}
return null;
}
public object ToDB(object clrValue)
{
if (clrValue != null && clrValue != DBNull.Value)
{
return ((DateTime)clrValue).ToUniversalTime();
}
return DBNull.Value;
}
}
}

View File

@ -82,7 +82,6 @@ namespace NzbDrone.Core.Datastore
MapRepository.Instance.RegisterTypeConverter(typeof(Boolean), new BooleanIntConverter());
MapRepository.Instance.RegisterTypeConverter(typeof(Enum), new EnumIntConverter());
MapRepository.Instance.RegisterTypeConverter(typeof(Quality), new QualityIntConverter());
MapRepository.Instance.RegisterTypeConverter(typeof(DateTime), new UtcDateTimeConverter());
}
private static void RegisterEmbeddedConverter()

View File

@ -193,7 +193,6 @@
<Compile Include="Datastore\Converters\QualityIntConverter.cs" />
<Compile Include="Datastore\Converters\Int32Converter.cs" />
<Compile Include="Datastore\Converters\EmbeddedDocumentConverter.cs" />
<Compile Include="Datastore\Converters\UtcDateTimeConverter.cs" />
<Compile Include="Datastore\Database.cs" />
<Compile Include="Datastore\DbFactory.cs" />
<Compile Include="Datastore\Converters\EnumIntConverter.cs" />