It annoys me because I would like to call a generic method from 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);
So, when I call ToList, which is an extension of the DataTable class (found out here )
The compiler says that Y is not a non-abstract type, and it cannot use it for the .ToList <> generic method.
What am I doing wrong?
Thanks for reading..
generics c #
bAN
source share