I have a row with 4 columns of data. I want to create an object A from the data in columns 1-2. If there is no data in columns 1-2, use columns 3-4 to create object B. In rare cases, we will have data in all columns, but the data in columns 2 and 4 do not match. In this case, I want to return object A and object B.
Is there a way to do this in dapper using multi-mapping? Or should I return an object C that contains all 4 columns, and then send data processing to create the objects A and B that I really want?
public class A { public long ID {get;set;} public long Value {get;set;} } public class B { public long ID {get;set;} public long Value {get;set;} }
Objects A and B are not related to each other (i.e. A does not contain a list B). Therefore, I am not sure how to proceed.
source share