I feel this is a stupid question even before asking, but my brain isn't working too well right now. I have two WCF services "CountryService" and "FloristService".
Now CountryService has the following method:
IList<CountryDTO> GetAllCountries();
Additionally, FloristService has a method:
bool AddFlorist(FloristDTO florist);
All good so far, but the problem is that the FloristDTO references a CountryDTO i.e.
public string Address1 { get; set; }
public string Address2 { get; set; }
public string Address3 { get; set; }
public string City { get; set; }
public string Postcode { get; set; }
public CountryDTO Country { get; set; }
public string Name { get; set; }
This is fine, but if I use the service proxy generating util with Visual Stuidos (i.e. Add Reference > Add Service Reference) then I get two versions of CountryDTO are created i.e.FloristService.CountryDTO and CountryService.CountryDTO.
Now I can think of a few ways to overcome this, but nonw of them seem right. I wondered what the "correct" approach to this would be, is there anything funky I can do with the proxy generation tool to make it share common DTOs?
Cheers, Chris
You can reuse types in svcutil: http://blogs.msdn.com/youssefm/archive/2009/10/09/reusing-types-in-referenced-assemblies-with-svcutil-s-r-switch.aspx
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