Parameter is less accessible than method

后端 未结 5 2020
既然无缘
既然无缘 2021-01-04 05:21

I\'m trying to pass a list from one form class to another. Here\'s the code:

List myArgus = new List();

private void btnLogin_Cl         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 05:49

    As the error message says, the type of all parameters of a method must be at least as accessible as the method itself.

    You need to make your Branch class public if you are using it as a parameter in a public method.

    public class Branch { .... } 
    ^^^^^^
    

    Alternatively you could change your method to be internal instead of public.

    internal BranchOverview(List myArgus)
    ^^^^^^^^
    

提交回复
热议问题