C# Inconsistent Accessibility (Multiple Classes)

Posted by MattP on Stack Overflow See other posts from Stack Overflow or by MattP
Published on 2011-02-23T15:23:08Z Indexed on 2011/02/23 15:24 UTC
Read the original article Hit count: 176

Filed under:
|

I am getting an Inconsistent Accessibility problem where I have one class that contains a List of another class

namespace NS {
public class Foo
{
    public Foo()
    {
        this.bar = new List<Bar>();
    }
    private List<Bar> bar;
}
public class Bar
{
    public Bar()
    {
    }
}
}

The error is property type NS.Bar is less accessible than property NS.Foo.Bar

The structure to the application is each Foo consists of a Dynamic Array (List) of Bar. It's not ecommerce but the best example would be an eCommerce Store->Categories->Products in terms of how the data will be accessed.

© Stack Overflow or respective owner

Related posts about c#

Related posts about class