0

我在将实体集合从 LLBLGen 传递回 silverlight 时遇到问题。我的合同是这样的。我什至不知道这是否可能。

我的网络服务代码如下所示:

public IEnumerable<WaterWorksCustomersEntity> GetCustomer(long custId, string acctKey)
{
    var toReturn = new WaterWorksCustomersEntity(custId, acctKey);
    using (var adapter = new DataAccessAdapter())
    {
        adapter.ConnectionString = "data source=CWCPROD.cwc.local;user.."; 
        adapter.FetchEntity(toReturn);
    }
    IList<WaterWorksCustomersEntity> customers = new List<WaterWorksCustomersEntity>();
    customers.Add(toReturn);
    return customers; 
}

在我正在做的silverlight客户端上......

var client = new Service1Client();
client.GetCustomerCompleted += new EventHandler<GetCustomerCompletedEventArgs>(client_GetCustomerCompleted);
client.GetCustomerAsync(2,"110865");

编译失败并出现此错误:

错误 1 ​​命名空间“AppointmentClientSL.ServiceReference1”中不存在类型或命名空间名称“ArrayOfXElement”(您是否缺少程序集引用?) c:\work\Appointment\Appointment\AppointmentClientSL\Service References\ServiceReference1\Reference.cs 63 54 预约客户SL

看起来 SL 无法处理 Web 服务返回的数据。

谁能帮忙???

4

2 回答 2

2

LLBLGEN 网站上有一个通过 WCF 调用 LLBLGEN 的示例: http ://www.llblgen.com/pages/secure/ListDownloads.aspx?ProductVersion=6#6

它正在通过 netTcp 进行同步调用,但可能有一些有用的线索......

于 2009-02-10T01:47:07.203 回答
0

Silverlight 构建在不同的 .NET 框架上,因此我们的实体类型不能在该平台上使用。如果您想将我们的实体类发送到 silverlight,请使用 DTO 类。我们的论坛有几个可用的模板,可以为您生成帮助代码 + DTO 类。搜索“DTO 模板”。

于 2010-04-16T06:38:07.623 回答