How to connect .NET Core Console application to SQL server database and read table data.
This blogpost explains how to connect .NET Core Console application to SQL server database and read table data. You will not be using the Entity framework for this. You will inject the dependency of IConfiguration to read appsettings.
- DAL -> DepartmentDAL.cs - has required code to connect to SQL server and get Department data.
- Models -> Department.cs - is a model for Department entity.
For more details click here