I have a datatable of data. I want to convert a subset and sepecific columns of the table data to a class object to pass to another method for analysis. I am trying to convert to a list to pass. Assistance to advise how to would be appreciated, either a smarter way or how to make this way work.
Class as follows
public class clsData
public decimal Back;
public decimal Mean;
Have data in a table, and trying to use LINQ to create a list (or array) to pass to a method as can't pass a VAR object.
var PastData = (from c in results
Back = c.Field<decimal>("Price"),
QMean = c.Field<decimal>("QMean")
Have tried to cast to the ClsData object without success. Then would want to receiveit in the method with something like
Public void List<ClsData> cd
Any advice would be appreciated