I'm getting an error with a property for a list. It's saying the list is less accessible than the property.. I'm not sure why I am getting this error..
//List
private List<Client> clientList = new List<Client>();
//Property
public List<Client> ClientListAccessor
{
get
{
return clientList;
}
set
{
clientList = value;
}
}
Thanks in advance for any help.
Most probably Client
is not a public class, and ClientListAccessor
is publically accessible. The caller will have access to the property but wouldn't know the type it returns.
That's happening, because the class Client
is not defined as a public
class. Make sure, the class definition looks like this:
public class Client
{
// ...
}
In your code it probably looks like this:
class Client
{
// ...
}
or like this (which is the same):
internal class Client
{
// ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With