Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    I don't see a good way to do that without duplicating code - Your new API can always call methods in your old API, or vice versa. Commented Oct 10, 2012 at 19:16
  • 2
    AutoMapper to the rescue, unfortunately yes- you need distinct versions of each contract, don't forget all objects referenced by your contract are a part of that contract. The result is your actual implementation should have it's own single version of models, and you need to transform the single version to the various contract versions. AutoMapper can help you here as well as making the internal models smarter than the contract models. In the absence of AutoMapper, I've used extension methods to create simple translations between internal models and contract models. Commented Oct 10, 2012 at 19:21
  • Is there a specific platform/context for this? (ie, DLL's, a REST API, etc) Commented Oct 10, 2012 at 22:01
  • .NET, with MVC and Webforms ui, dll classes. We have both a rest and soap API. Commented Oct 10, 2012 at 22:20