0
public interface IMyService
{
void GetValue();
}
public class MyService : ClientBase<IMyService>, IMyService
{
public MyService()
{
EndPoint = "Test";
}
public void GetValue()
{
}
}
public interface ICommunication
{
void Start();
}
public class ClientBase<T> : ICommunication
{
public string EndPoint { get; set; }
public void Start()
{
}
}
我的测试项目中读取基类的属性如何从我的接口实例
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
ICommunication communication = new MyService();
}
}
如何访问从通信对象的EndPoint属性?
我的目标是从ICommunication实例中读取EndPoint的值。如何转换的ICommunication接口ClientBase泛型类
注:我们有多个服务classes.Is有没有办法从我ICommunication
我忘了把这一个。我们有多个服务类。有没有办法从我的ICommunication中获得ClientBase的实例 –