As of now our collection properties violate the CA1819 and CA2227 rules for managed code.
We should change the collection properties to conform to those rules, as seem exemplary below. This is the recommended way to do things and should not affect performance in any significant way.
public ICollection<CombatAttribute> Attributes { get; private set; } = new Collection<CombatAttribute>(0);
public void SetCollection(IEnumerable<CombatAttribute> attributes)
{
if(attributes == null)
{
throw new ArgumentNullException();
}
this.Attributes = attributes;
}
Since the C# compiler generates instance methods in the MSIL for properties, we can remove the setter and replace it with a method which just assigns the collection. This shold not degrade performance
References:
#30