Q:

Operator '+' cannot be applied to operands of type

I'm having an error. Its saying that the

'+' operator cannot be applied to operands of type

. the code follows as :
Violator.HowManyViolsInMonthRange(dNum, lvsMajors + lvsIntox, 0, 11 >= 2)

The error occurs at lvsMajors + lvsIntox. They are both HashSet<int>(); with some constants applied to them.
The auto text prediction format follows as :
int(dNum), HashSet<int> violCodeSet (lvsMajors & lvsIntox), minMonth, maxMonth.

Thank You

A:

The + operator is not overloaded for HashSet<T>. But how do you want to add two HashSet<int> at all? I can think of at least two ways:
lvsMajors.Sum() + lvsIntox.Sum()

or
lvsMajors.UnionWith(lvsIntox)

