1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-17 21:26:22 -04:00

added ConverterContext to marr Converters.

This commit is contained in:
kay.one
2013-09-20 23:38:27 -07:00
committed by kayone
parent d1a4c7c942
commit 08e2d60f20
15 changed files with 153 additions and 34 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Data.Common;
using Marr.Data.Converters;
namespace Marr.Data.Mapping
{
@@ -53,7 +54,15 @@ namespace Marr.Data.Mapping
// Handle conversions
if (dataMap.Converter != null)
{
dbValue = dataMap.Converter.FromDB(dataMap, dbValue);
var convertContext = new ConverterContext
{
DbValue = dbValue,
ColumnMap = dataMap,
MapCollection = mappings,
DataRecord = reader
};
dbValue = dataMap.Converter.FromDB(convertContext);
}
if (dbValue != DBNull.Value && dbValue != null)