We have a typical N-Layer.NET application that sits between our database and the web API service level. This application consists of Business Layer, Data Repository / Access, as well as related DTOs and Business Objects.
We have solutions for the version of our stored procedures and our web API endpoints. The problem is the solution for the version of this middle tier, the actual class methods, and the schema objects. All Google searches contain results for the source code of the version in the version control solution or how to use the version using the Assembly information, neither what we mean, nor are the results limited.
So, for example, we have two endpoints:
... api / v1 / tax / charges
... api / v2 / tax / value
v1 should hit one version of the CalculateTaxPctgs method and v2, which falls into another version with updated business logic. Along with the need to use different versions of POCO Tax and TaxItems, since we changed the name of one field in version 2.
It is easy to develop, but difficult to manage and a very tough / static solution would be to create two different methods CalculateTaxPctgs_V1 and CalculateTaxPctgs_V2. That doesn't sound like a good idea.
It is difficult to find best practices or even alternative solutions to this dilemma. This is an enterprise application that processes millions of requests every day, so performance is extremely important, but it is also the management and reliability of the code.
source share