An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
How do you store data in an instance of MyBox?
Is it acceptable to put the obtained data in the datatable and then manually convert it to MyBox?
public static List<MyBox> GetMyClasses(DataTable dataTable)
{
List<MyBox> items = dataTable.AsEnumerable().Select(row =>
new MyBox
{
New = row.Field<bool>("New"),
Box = new Box() { Name = row.Field<string>("Name"), Color = row.Field<string>("Color"),Desc = row.Field<string>("Desc") }
}).ToList();
return items;
}
Or are you using an orm framework like EF?
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.