So, when starting out to build a Web API with ASP.Net you first need to do some resarch on best practices and get an idea of how you are going to implment it.
Some Background Research Links:
Microsoft API implementation guidance: https://docs.microsoft.com/en-us/azure/best-practices-api-implementation
Calling a Web API From a .NET Client (C#) : https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client
Best practice for creating HttpClient and calling an API: http://codereview.stackexchange.com/questions/111882/clean-call-api-from-client-with-good-practice
Complete Example for Error Handlers: https://msdn.microsoft.com/en-us/library/bb397417.aspx
This is a generic asp.net error handling article, good background, not specific to API or MVC calling an API
Exception Handling in ASP.NET Web API Application: https://www.exceptionnotfound.net/the-asp-net-web-api-exception-handling-pipeline-a-guided-tour/
This is things we can do in the API to make our errors more meaningful.
Project Mechanics is a Mark Hazleton project © 2002 - 2023