Take a simple example - I have a 'Car' class that inherits from a 'Vehicle' class (BTW I've using Vs2010 and C#). I write myself a trivial web server method (using asmx) that returns a 'Car'.
Looking at the WSDL from the ASP.net generated pages I get WSDL generated from the underlying 'Vehicle' class as well as the 'Car' class. Given开发者_如何转开发 that the outside world need have no knowledge of the 'Vehicle' class is there any way I can stop the WSDL.exe producing code for it?
Thanks
SAL
I think in this case you should simply create a separate Car
class (that doesn't inherit from Vehicle
) for the purposes of serialization, and map between them. AutoMapper may help remove some mapping code, but it shouldn't be tricky either way.
精彩评论