public partial class Apply_Write : BLL.BasePageApply_Write页面继承了基类BLL.BasePage,已知该基类有一个info实体类,并已赋值,现在想取得info实体类中的某个属性值(如id),应该如何做?
比如:int infoID = info.id; //出错,info.并没有id列出应该如何引用实体类中的属性值啊?谢谢!
比如:int infoID = info.id; //出错,info.并没有id列出应该如何引用实体类中的属性值啊?谢谢!
private info inf;
public int InfoID
{
get{return inf.id;}
set{inf.id=value;}
}
using System.Collections.Generic;
using System.Text;namespace Library
{
public class info
{
private int _id; public int ID
{
get { return _id; }
set
{
_id = value;
}
}
}
}
基类BasePageusing System;
using System.Collections.Generic;
using System.Text;namespace Library
{
public class BasePage
{
protected info abcd;
}
}
测试类using System;
using System.Collections.Generic;
using System.Text;namespace Library
{
public class tt:BasePage
{
private int abc;
private tt()
{
abc = abcd.ID;
}
}
}
测试通过
2)info.Id属性是否为protected/internal/public?