Getting Null Exception for Entity Framework core 1.1
found the answer, need to sorted connection-String in appsettings.json
"Data": {
"UCASAppDatabase": {
"ConnectionString": "Data Source=mysource;Initial Catalog=UCAS-DB;Integrated Security=True;Persist Security Info=True"
}
}
and in Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddApplicationInsightsTelemetry(Configuration);
services.AddDbContext<TestDbContext>(options =>
options.UseSqlServer(Configuration["Data:UCASAppDatabase:ConnectionString"]));
services.AddMvc();
}