bltoolkit
bltoolkit copied to clipboard
MapValue sometimes maps incorrectly with XML-extended mapping schema
Hello!
[TableName("Persons")]
public class Person
{
[MapField("UserId"), Identity, PrimaryKey]
public int Id { get; set; }
[MapValue(true, "Y")]
[MapValue(false, "N")]
public bool IsActive { get; set; }
}
If we create this kind of mapping by attributes, retrieval and persistence work as expected. However, if we move this mapping into an XML file (https://gist.github.com/starteleport/4754058), things get different, as shown by these unit tests: https://gist.github.com/starteleport/4754071.
UPD: The test TestMapValueAttribute_Passes would not work with current version of BLT in this repo, as there's a small bug with custom mapping schema not being applied, see https://github.com/igor-tkachev/bltoolkit/pull/156.
UPD2. The problem could be reproduced now.