I have to wrap legacy .net assembly API (set of classes and interfaces) with WCF service. Service is visioned as proxy that delegates calls to existing classes with virtually no additional work.
So I addded [ServiceContract] interface
that exposes methods that deals with existing structures and classes. But wcf-proxy-generator (svcutil) removed some fields (declared as read-only) and is not smart enough for aliases (for example: public bool Boolean1 { get { return Booleans[0] }}
turned into bool Boolean1 { get; set; }
).
I decided to duplicate such legacy classes in order to remove the confusion. Now there are contract-safe version for some of existing classes & WCF service has additional code that translate contract-safe classes into legacy ones & vise versa.
Would you suggest to duplicate all the legacy classes or is it ok to have conversion only for problem ones? May be there are some extra proxy generator parameters I missed.
Thank you in advance!