You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i am facing the same problem. Ican not detect wether a registartion is done or not. Is there any news? I get following error:
System.InvalidOperationException: Mapping from System.Data.DataTable to System.Collections.Generic.List`1[[DPLDataProvider.Models.Model, DPLDataProvider, Version=0.0.9.0, Culture=neutral, PublicKeyToken=null]] is already registered
bei ExpressMapper.MappingServiceProvider.RegisterCustomT,TN,TMapper in C:\Source\ExpressMapper\Expressmapper.Shared\MappingServiceProvider.cs:Zeile 999.
Mapper.MapExists() method return false for Register made using RegisterCustom<T, TN>(Func<T, TN> mapFunc) method. Is it the normal behaviour ?
See code sample:
using System;
using ExpressMapper;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace RegisterCustomIssue
{
enum CHAR
{
A,
B,
C
}
enum NBR
{
ONE,
TWO,
THREE
}
public static class RegisterMapper
{
public static void Register()
{
if (!Mapper.MapExists(typeof(CHAR), typeof(NBR)))
{
Mapper.RegisterCustom<CHAR, NBR>(
src =>
{
switch (src)
{
case CHAR.A: return NBR.ONE;
case CHAR.B: return NBR.TWO;
case CHAR.C: return NBR.THREE;
default: return NBR.ONE;
}
}
);
}
}
}
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
RegisterMapper.Register();
RegisterMapper.Register();
Assert.IsTrue(true);
}
}
}
The text was updated successfully, but these errors were encountered: