Silverlight WCF access returning an IList of LLBLGen entities?

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2009-02-09T13:37:59Z Indexed on 2010/04/16 6:43 UTC
Read the original article Hit count: 741

Filed under:

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 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 customers = new List(); customers.Add(toReturn); return customers; }

On the silverlight client I'm doing ...

var client = new Service1Client(); client.GetCustomerCompleted +=new EventHandler(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???

© Stack Overflow or respective owner

Related posts about silverlight-2.0