The following code gives me a warning about possible multiple enumeration of IEnumerable:
public ClassName(IEnumerable<OtherClassName> models) : base(models)
{
_models.AddRange(models);
}
The normal solutions for removing this warning do not work because of the "base" call. I cannot convert to a list because there is no place to store that list.
Is my only option to make the constructor take a list as a parameter? Is that recommended practice in this case?