csharp 使用简单代理的示例服务类

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 使用简单代理的示例服务类相关的知识,希望对你有一定的参考价值。

using System.Xml.Linq;

namespace LeeSoft.TestUtils.SimpleProxy
{
    public interface IService
    {
        XDocument GetData();
    }
}
using System.Xml.Linq;

namespace LeeSoft.TestUtils.SimpleProxy
{
    public class ConcreteService: IService
    {
        protected IServiceProxy ServiceProxy;

        public ConcreteService(IServiceProxy serviceProxy)
        {
            ServiceProxy = serviceProxy;
        }

        public XDocument GetData()
        {
            return ServiceProxy.Load();
        }
    }
}
 

以上是关于csharp 使用简单代理的示例服务类的主要内容,如果未能解决你的问题,请参考以下文章