美好的一天人们。我从来没有在这些类型的网站上发布过,但是让我们看看它是如何发展的。WCF服务客户端
今天我第一次开始使用WCF,我看了几个截屏,现在我准备跳入我的第一个实现它的解决方案。一切都很好,到目前为止所有的工作,虽然我的问题来了,当我在我的调用程序/客户端创建WCFServiceClient。
可以说我的ServiceContract /接口定义了我的方法暴露给客户端,有许多方法每个都与某个实体对象有关。我怎样才能将一个特定实体的所有相关方法逻辑分组在一起,以便在我的代码中它看起来像
WCFServiceClient.Entity1.Insert();
WCFServiceClient.Entity1.Delete();
WCFServiceClient.Entity1.GetAll();
WCFServiceClient.Entity1.GetById(int id);
WCFServiceClient.Entity2.AddSomething();
WCFServiceClient.Entity2.RemoveSomething();
WCFServiceClient.Entity2.SelectSomething();
...
而不是
WCFServiceClient.Insert();
WCFServiceClient.Delete();
WCFServiceClient.GetAll();
WCFServiceClient.GetById(int id);
WCFServiceClient.AddSomething();
WCFServiceClient.RemoveSomething();
WCFServiceClient.SelectSomething();
我希望这是有道理的。我搜索谷歌,我已经尝试了我自己的逻辑推理,但没有运气。任何想法,将不胜感激。
射击 胡安
欢迎!发布代码时,单击工具栏上的格式代码按钮('101')以正确格式化。 – SLaks 2010-02-17 13:15:19