I am annoyed because I would like to call a generic method from a another generic method..
Here is my code:
public List<Y> GetList<Y>(
string aTableName,
bool aWithNoChoice)
{
this.TableName = aTableName;
this.WithNoChoice = aWithNoChoice;
DataTable dt = ReturnResults.ReturnDataTable("spp_GetSpecificParametersList", this);
//extension de la classe datatable
List<Y> resultList = (List<Y>)dt.ToList<Y>();
return resultList;
}
So in fact when I call ToList who is an extension to DataTable class (learned Here)
The compiler says that Y is not a non-abstract Type and he can't use it for .ToList<> generic method..
What am I doing wrong?
Thanks for reading..