I have the following method which I use to fill a DropDownList-Control.
protected void LoadDropDownList(DropDownList ddl, IEnumerable<A> source)
{
ddl.DataSource = source;
ddl.DataBind();
}
My question is, can I make the method more abstract so that it can also take IEnumerables of type B?
protected void LoadDropDownList<T>(DropDownList ddl, IEnumerable<T> source) {
...
See also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With