In the web servce I say
public List<Customer> GetCustomers()
{
PR1Entities dc = new PR1Entities();
var q = (from x in dc.Customers
select x).ToList();
return q;
}
(customer is a entity object)
Then I generate the proxy when I add the service.. and in the reference.cd it say
public wcf1.ServiceReference1.Customer[] GetCustomers() {
return base.Channel.GetCustomers();
}
WHY IS IT AN ARRAY? I asked for a List.
help.
Right click on the service reference and select Configure Service Reference.
In the Collection Type drop-down, select the type System.Collections.Generic.List.
I believe the reason it defaults to Array is that it is the most compatible when serializing. If you're consuming the service from something that recognizes something more complex, you can configure as I mentioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With