-2

I am passing a list of objects I have added to into a new form through its constructor and this is where the error is shown

public FindRoute(List<AddedLocation> AddedLocation)
    {

        ...
        
    }

here is the class which it is based on

class AddedLocation
{
    public string name;
    public string PlaceID;

    public AddedLocation(string _name,string _PlaceID)
    {
        name = _name;
        PlaceID = _PlaceID;
    }
   
}
A b
  • 1
  • 1

1 Answers1

0

Change your class declaration from class AddedLocation to public class AddedLocation. Since you have not declared a protection level, it defaults to internal which is less accessible than public, which is what your constructor is declared.

Please see what-are-the-default-access-modifiers-in-c#

Ryan Wilson
  • 10,223
  • 2
  • 21
  • 40