[RESOLVED][2.0] Problem passing List<T>
HI all I have a Method that I wish to pass a generic List as a parameter,
Code:
public void Test (List<Client> temp)
{
this.ClaimBindingSource.DataSource = temp;
}
The idea is then to bind it for a data report.
But upon trying to compile i get the following error
Quote:
Error 1 Inconsistent accessibility: parameter type 'System.Collections.Generic.List<Indemnity_System.Client>' is less accessible than method 'Indemnity_System.ReportView.Test(System.Collections.Generic.List<Indemnity_System.Client>)'
If I use an ArrayList I do not get this problem any help would be great.
:wave: :thumb: :wave:
Re: [2.0] Problem passing List<T>
Re: [2.0] Problem passing List<T>
Yes Client is a public class.
Re: [2.0] Problem passing List<T>
How is the Client class or structure declared? I'm guessing that it has lower accessibility than public, right? If so then that's your problem: you're exposing a type that is not public through a method that is. The ArrayList doesn't give you the issue because ti has no specific connection to the Client type.
And after typing that I decidied to read dee-u's post and I see that I'm a bit late with the advice. :blush:
Re: [2.0] Problem passing List<T>
Quote:
Originally Posted by Bombdrop
Yes Client is a public class.
Or maybe I spoke too soon. Are you absolutely sure that it's public because that's the exact error message I get if I declare an internal Client class and then use the exact method declaration that you did?
Re: [2.0] Problem passing List<T>
SOrry guys it's always the stupid things that trip you up I had not declared my class as public :blush: :blush: Sorry but thanks for the helps
:thumb: :thumb: