We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to map Dapper Data to an Object. But am facing problem while mapping to Dictionary objects.
The Requirement is to map a Data Row to an Object. Data Row 1 | Key1 | Value1 1 | Key2 | Value2
Expected Values Id -> 1 Data -> {{"Key1","Value1" }, { "Key2","Value2"}}
Id -> 1
Data -> {{"Key1","Value1" }, { "Key2","Value2"}}
Map Code:
IDictionary<string, object> entity = new Dictionary<string, object>(); entity.Add("Id", "1"); entity.Add("Data_Key", new List<string>() { "Key1", "Key2" }); entity.Add("Data_Value", new List<string>() { "Value1", "Value2" }); var result=Slapper.AutoMapper.Map<TestEntity>(entity);
Entity Object
public class TestEntity { public int Id { get; set; } public Dictionary<string,string> Data { get; set; } }
Is there a way to achieve this ??
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to map Dapper Data to an Object. But am facing problem while mapping to Dictionary objects.
The Requirement is to map a Data Row to an Object.
Data Row
1 | Key1 | Value1
1 | Key2 | Value2
Expected Values
Id -> 1
Data -> {{"Key1","Value1" }, { "Key2","Value2"}}
Map Code:
Entity Object
Is there a way to achieve this ??
The text was updated successfully, but these errors were encountered: