类与类之间的传值
public class A : AbstractDataGateway
{
private BranchCorpGateWay Instance = new BranchCorpGateWay();
}
public class B : DataModelBase
{
}
现在要在b里面调用Instance,请问该怎么办?
注:不能用静态方法。
------解决方案--------------------public class A : AbstractDataGateway
{
public BranchCorpGateWay Instance = new BranchCorpGateWay();
}
public class B : DataModelBase
{
A myA = new A();
myA.Instance ......
}