EF+WCF查询不到数据

单独运行服务端,使用vs的wcf测试客户端,ef可以查到数据。但是在客户端调用服务就查不到数据了。
服务端查询代码
 public  class TestService
{
private WcfServerConnection db = new WcfServerConnection();
public List<TestData> GetList()
{

var persons = from p in db.TestEntitys
select new TestData
{
ID = p.ID, Conten = p.Content

};


var ulits = persons.ToList();
return ulits;
}
}

客户端调用
   public string Test()
{
EndpointAddress edpHttp = new EndpointAddress("http://localhost:57840/");

ClientFactory client = new ClientFactory(new WSHttpBinding(SecurityMode.None), edpHttp);

string temp = client.GetTest().ToString();
return temp;


}


 public  class ClientFactory:ClientBase<ITest>,ITest
{
public ClientFactory(System.ServiceModel.Channels.Binding binding, EndpointAddress edpAddr)
: base(binding, edpAddr) { }

public void WcfTest() {
;
}

public List<TestData> GetTest()
{
return base.Channel.GetTest();
}



}
...全文
229 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
http://localhost:57840/ 路径对吗?你设置了默认文档的么
  • 打赏
  • 举报
回复
客户端调用查询,调试发现 var ulits = persons.ToList(); 没有数据,count=0

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧