I have a question about how to pivot a sql table column into a list of objects.
Assume I have a product table with columns:
product id location price
1 x $10
1 y $12
1 z $14
I created a (location, price) class and a product class as:
public class priceLocation
public string location;
public decimal price;
public class product
public int productid;
public list<priceLocation> priceLocations;
public list<object> locationprice
How can I load the above sql data to these classes?