How come if I run this code:
namespace TestCode
{
public class EnumList<TEnum>
{
private IList<TEnum> _list;
public EnumList()
{
_list = new List<TEnum>();
}
public void Add(TEnum val)
{
_list.Add(val);
}
public int Get(TEnum val)
{
return (int)(from one in _list
where one == val
select one).First();
}
}
}
Gives me an error to do with not being able to convert type TEnum to type TestCode.TEnum?
(This is 'paraphrased' by the way as my actual code is at home and I'm at work)
Edit: Removed the <TEnum>
from the constructor as that's not the main problem