Dev

Working with minimal APIs in .NET



There’s support for all the essential HTTP operations: MapGet, MapPut, MapPost, and MapDelete. These will allow you to build most of the common API functions and manage the payloads for your code. Client applications and views will need to implement the HTTP operation created by the mapping. More complex operations can use the MapMethods to support other HTTP operations.

There’s no need to write code to manage serialization, so, for example, if you’re using a MapPost endpoint and delivering a JSON object, it will automatically populate a .NET object with its contents.

Once a minimal API route has been matched, .NET fires up a route handler. This can be any form of method, though in most cases inline lambda expressions are an effective way to quickly handle and respond to inputs. Alternatively, you can define a function outside the minimal API and have the route handler call it.



READ SOURCE

This website uses cookies. By continuing to use this site, you accept our use of cookies.