I've got a WCF Web Service method whose prototype is:
[OperationContract]
Response<List<Customer>> GetCustomers();
When I add the service reference to a client, Visual Studio (2005) creates a type called "ResponseOfArrayOfCustomerrleXg3IC" that is a wrapper for "Response<List<Customer>>". Is there any way I can control the wrapper name? ResponseOfArrayOfCustomerrleXg3IC doesn't sound very appealing...
You can define your own name in the DataContract
attribute like this:
[DataContract(Name = "ResponseOf{0}")]
public class Response<T>
Note that in your example the {0}
will be replaced and your proxy reference type will be ResponseOfArrayOfCustomer
.
More info here: WCF: Serialization and Generics
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