I have a list that will currently return something like this. the Att column can be anything because a user can enter in a Att and Value at anytime.
var attr_vals = (from mpav in _db.MemberProductAttributeValues
select mpav);
Results
Id Att Value
1 Color Blue
1 Size 30
1 Special Slim
3 Color Blue
4 Size 30
2 Special Slim
2 Random Foo Foo
The conversion I am looking for would be similar to this
Converted results
Id Color Size Special Random
1 Blue 30 Slim null
2 null null null Foo Foo
3 Blue null null null
4 null 52 null null
Class looks like this so far.
public class MyMappProducts
{
public int? id { get; set; }
public Dictionary<string, string> Attributes { get; set; }
string GetAttribute(string aName)
{
return Attributes[aName];
}
void setAttribute(string aName, string aValue)
{
Attributes[aName] = aValue;
}
}