I want to restrict the possible types N can take-on using a constraint. I wish to restrict N to be either a int or a decimal.
public static Chart PopulateInto<T, N>(List<T> yAxis, List<N> xAxis) where N : int, decimal
{
// Do stuff here
}
Any help appreciated...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…