Can you please explain to me what
where T : class, new()
void Add<T>(T item) where T : class, new();
That is a constraint on the generic parameter
T. It must be a
class (reference type) and must have a public parameter-less default constructor.
T can't be an
DateTime or any other
struct (value type).
It could be a
string, or any other custom reference type, as long as it has an default or parameter-less constructor.