views:

859

answers:

2

Hi

I'm having a problem passing an entity collection back from LLBLGen to silverlight. My contract looks like this. I don't even know if this is possible.

My web service code looks like this:

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; 
}

On the silverlight client I'm doing ...

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

The compilation is failing with this error:

Error 1 The type or namespace name 'ArrayOfXElement' does not exist in the namespace 'AppointmentClientSL.ServiceReference1' (are you missing an assembly reference?) c:\work\Appointment\Appointment\AppointmentClientSL\Service References\ServiceReference1\Reference.cs 63 54 AppointmentClientSL

It looks like SL is not able to deal with the data the web service is returning.

Can anyone help???

+2  A: 

There is an example of calling LLBLGEN over WCF on the LLBLGEN website here: http://www.llblgen.com/pages/secure/ListDownloads.aspx?ProductVersion=6#6

It's doing synchronous calls over netTcp, but there might be some usefull clues...

Scrappydog
A: 

Silverlight is build on a different .NET framework, and our entity types therefore can't be used on that platform. If you want to send our entity classes to silverlight, use DTO classes. Our forum has several templates available which can generate helper code + DTO classes for you. Search for 'DTO template'.

Frans Bouma