基本的に、SQLデータテーブルを正常に実行できる汎用リストに変換しています。しかし、リストオブジェクトを返す方法がわかりません。のバリエーションであるというエラーが表示されます-タイプSystem.Collections.Generic.IListをSystem.Collections.Generic.Listに暗黙的に変換できません
リストをタイプリストとして返す正しい方法は何でしょうか?
public List<MyObject> GetAllMyObjects()
{
String command = "select * from names ";
DataTable tableResult = DataTableToList.ExecuteDataTable(command, CommandType.Text, null,connectionString);
IList<MyObject> theList = DataTableToList.ConvertTo<MyObject>(tableResult);
return // I’m not sure how to return theList here...
}