Zaak
Zaak

Reputation: 482

How to configure service reference not to change the List<string> parameter to Observable Collection in Silverlight?

i have a method on service that as one of its parameters accepts List.

when i make a reference to said service in my silverlight app, it defines the parameter as ObservableCollection.

why does it do that, since this is not result of service call. and how do i configure it to use List<> but just for the said parameter, and not for all the results and parameters for rest of the methods in service.

service method:

public void deleteUsers(List<string> usernames){ ... }

auto generated reference in sliverlight app:

public void deleteUsers(System.Collections.ObjectModel.ObservableCollection<string> usernames){ this.deleteUsersAsync(usernames,null);}

Thank you

Upvotes: 2

Views: 599

Answers (1)

Vladimir Dorokhov
Vladimir Dorokhov

Reputation: 3839

When you are adding service reference change in Advanced settings Collection Return Type from default ObservableCollection to List type. If you already have Service Reference added Right click your ServiceReference to open ServiceReference Configuration window. Change the Collection Return Type to System.List.

Upvotes: 1

Related Questions