I create a new project empty web application in visual studio 2017. Then i create i database with sqlserver and i try to use dapper. i write a method an i get in error in the line
using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString))
{
return Ok(db.Query<Employee>
("Select * From ergaz").ToList());
}
I created a web.config gile which put the code
<connectionStrings>
<add name="myConnectionString" connectionString="Data Source=aaaaaaa\SQLEXPRESS;Initial Catalog=APIDB;Integrated Security=True;" />
but the word ConfigurationManager has red underline and say that
using the generic type 'configurationmanager T ' requires 1 type arguments
I have use the using System.Configuration; I search to add assembly reference in the solution but when i try to add it the pop up window is empty. screenshot