Skip to content

Gendarme.Rules.Design.Generic.DoNotExposeGenericListsRule(2.10)

Sebastien Pouliot edited this page Jan 22, 2011 · 2 revisions

DoNotExposeGenericListsRule

Assembly: Gendarme.Rules.Design.Generic
Version: 2.10

Description

A type has an externally visible member that is, returns, or has a signature containing a System.Collections.Generic.List.

Examples

Bad example:

public class BadClass {
    public List<string> member { get; set; };
}

Good example:

public class GoodClass {
    public Collection<string> member { get; set; };
}
Clone this wiki locally