Inconsistent accessibility: property type is less accessible

后端 未结 3 1233
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 05:34

Please can someone help with the following error:

Inconsistent accessibility: property type \'Test.Delivery\' is less accessible than property \'Test.

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 05:53

    Your Delivery class is internal (the default visibility for classes), however the property (and presumably the containing class) are public, so the property is more accessible than the Delivery class. You need to either make Delivery public, or restrict the visibility of the thelivery property.

提交回复
热议问题