tmsmith/Dapper-Extensions — Issue #25: Detect Nullable Types for Identity Columns
Author: colinbowern
Created: 2012-01-06 18:48:00+00:00
State: open

In the ClassMapper.AutoMap method please consider added support for nullable types int and Guid:

if (map.PropertyInfo.PropertyType == typeof(int) || map.PropertyInfo.PropertyType == typeof(int?))
{
map.Key(KeyType.Identity);
}
else if (map.PropertyInfo.PropertyType == typeof(Guid) || || map.PropertyInfo.PropertyType == typeof(Guid?))
{
map.Key(KeyType.Guid);
}
//...