I'm using Insight.Database
as our micro-ORM. I wanted to figure out if there is a way to take the following POCO class associations and map results from a single row into these objects.
public class Rule
{
public int Id { get; set; }
public string Name { get; set; }
public RuleDetail Source { get; set; }
public RuleDetail Destination { get; set; }
}
public class RuleDetail
{
public int Id { get; set; }
public Name { get; set; }
public Date DateTime { get; set; }
// omitted...
}
Here is the columns that are returned from our stored procedure:
Id
Name
// Should map to Source object.
SourceId
SourceName
SourceDateTime
// Should map to Destination object.
DestinationId
DestinationName
DestinationDateTime