I am struggling on how to connect existing database with existing data to my API project. And also how do I know if I'm already connected? I am using .NET Core 1.1 and my database is SQL Server 2012.
appsettings.json :
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"ConnectionStrings": {
"DefaultConnection": "Server=.\\SQLEXPRESS;Database=;User Id=sa;Password=Passw0rd;MultipleActiveResultSets=True"
}
}
}
Startup.cs - ConfigureServices
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddDbContext<DefaultConnection>(
options => options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
}
I am following this tutorial but it seems that this creates new database. http://www.mithunvp.com/aspnet-core-web-api-entity-framework-core/
Would highly appreciate all your comments/solutions/suggestions.

Server=.\\SQLEXPRESStoServer=COGSOL-LAP13... Read How to Ask, explain very explicitly what is and isn't working ("I am struggling" is not a proper problem description), and show what you have tried.