New with MVC and WebAPI and going through a few tutorials.
I have created a WebAPI project. This project calls another Class Library (Unit of Work) to return its classes/methods such as a list of products a single product etc etc. All is working in Postman.
I create a new MVC project and would like to call this WebAPI project to retrieve the data and place it on my page.
I decided to use WebAPI so it could be used on other platforms i.e phones etc. My first attempt i wrote some code using the HttpClient in the MVC project but i am finding that i'm close to repeating multiple HttpClient calls to retrieve methods such as GetProducts, GetProduct, AddProduct, DeleteProduct.
Is there a better way to call these methods without using HttpClient in code behind? Or at least a structured approach so i dont always have to rebuild the project to call a different method in case i selected the wrong one against a specific page?