Reputation: 11412
I'm trying to use Slapper.AutoMapper
alongside Dapper
to accomplish something like this: How do I write one to many query in Dapper.Net?.
My POCO is like this:
public class MyEntity
{
public string Name { get; set; }
public string Description { get; set; }
public int Level { get; set; }
public IList<int> Types { get; set; }
}
And my DB rows returned are like this:
So one entity can have many Types. This is how I map the stuff:
dynamic test = conn.Query<dynamic>(sql); Slapper.AutoMapper.Configuration.AddIdentifier(typeof(MyEntity), "Name");
var testContact = Slapper.AutoMapper.MapDynamic<MyEntity>(test);
However in all my result objects the Types property is null. How can I map all the Type values in to the IList Types?
Upvotes: 3
Views: 4036