-4

I want to extend our api to a (better) v2 version. I came up with the plan of adding a "v2" area and under that, cloning each controller into it. (basically v1 sometimes returns json, sometimes text, sometimes ysod and we're standardising our responses). So we now support both v1 and v2 via:

v1 "abc.com/billing" <- same as it's always been

v2 "abc.com/v2/billing" <- new v2

I've been having trouble with routing to two identically named controllers, but I think it's fixable. is this idea (i.e. using Areas) a good one or have I missed a trick? I like the idea of using Areas because I think it scales well when we move to v3. Thanks


thanks for the suggested duplicate, but what I'm after is a way to achieve a desired routing using either Areas or other means. It is an api, but hopefully the question still stands if I wanted to route to two different, but identically named controllers.

0

I'm wrong. the duplicate answer links to Troy hunt, who's got a decent answer. Thanks https://www.troyhunt.com/your-api-versioning-is-wrong-which-is/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.