I like SqlFu a lot, and recently started to use the multi-poco mapping feature.
I have created a ViewModel, containing several Entities, and a large query that aliases fields as required. Works perfectly, however, it seems all Nullable fields and Guids in my Entity objects come back empty from the query.
It seems those fields are not mapped. I debugged a little bit, and think the problem is in line 55 of DefaultComplexTypeMapper.cs:
if (Type.GetTypeCode(p.PropertyType) == TypeCode.Object) return null.
if i change this line to:
if (Type.GetTypeCode(p.PropertyType) == TypeCode.Object && Nullable.GetUnderlyingType(p.PropertyType) == null && p.PropertyType != typeof(Guid)) // allow nullable types and guids to be mapped
return null;
then my problem is solved. But I'm not really sure this is the best possible fix, there sure is more to this. Maybe you can look into this?
I like SqlFu a lot, and recently started to use the multi-poco mapping feature.
I have created a ViewModel, containing several Entities, and a large query that aliases fields as required. Works perfectly, however, it seems all Nullable fields and Guids in my Entity objects come back empty from the query.
It seems those fields are not mapped. I debugged a little bit, and think the problem is in line 55 of DefaultComplexTypeMapper.cs:
if i change this line to:
then my problem is solved. But I'm not really sure this is the best possible fix, there sure is more to this. Maybe you can look into this?