Total Articles: 1

It's very easy to get started using Minimal Web APIs in .NET Core, but as the number of routes grows , your Program.cs file can easily become overwhelming to maintain. Instead of keeping all your app.Map*() methods in the Program.cs file, you should create a Router class to separate your groups of app.Map() methods into. For example, if you have a set of CRUD routes for working with products and another set for working with customers, create a ProductRouter class and a CustomerRouter class. In this article, you're going to see how to move each group of Web APIs into their own router class to provide a much more consistent and maintainable way to create Minimal Web API calls.