Hi,

There are several methods to retrieve SQL data in C#. So you can use Entity Framework or ADO.NET to fetch the data from the database. Regardless of the method chosen, it is possible to write the necessary logic within a Web API.

You can go through this article.

https://www.c-sharpcorner.com/article/creating-a-web-api-post-method-to-retrieve-data-from-sql-database-using-asp-net/