不能使用实例引用访问成员‘<Method>’
namespace MyDataLayer{
namespace Section1
{
public class MyClass
{
public class MyItem
{
public static string Property1{ get; set; }
}
public static MyItem GetItem()
{
MyItem theItem = new MyItem();
theItem.Property1 = "MyValue";
return theItem;
}
}
}
}using MyDataLayer.Section1;public class MyClass{
protected void MyMethod
{
MyClass.MyItem oItem = new MyClass.MyItem();
oItem = MyClass.GetItem();
someLiteral.Text = oItem.Property1;
}}Property1Equals, GetHashCode, GetTypeToStringoItem.Property1
MemberMyDataLayer.Section1.MyClass.MyItem.Property1.get cannot be accessed with an instance reference, qualify it with a type name instead
繁星coding
守着星空守着你
随时随地看视频慕课网APP
相关分类