Skip to content

Commit

Permalink
Fix SQLite connection string (OmniSharp#656)
Browse files Browse the repository at this point in the history
The RC2 uses new convention for Configuration
access of connection strings. This commit
adopts that convention to construct and later
read SQLite configuration
  • Loading branch information
peterblazejewicz committed May 14, 2016
1 parent f4b7e46 commit 8a4d9fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/projects/web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Startup(IHostingEnvironment env)

builder.AddEnvironmentVariables();
Configuration = builder.Build();
Configuration["Data:DefaultConnection:ConnectionString"] = $@"Data Source={env.ContentRootPath}/<%= namespace %>.db";
Configuration["ConnectionStrings:SQLite"] = $@"Data Source={env.ContentRootPath}/<%= namespace %>.db";
}

public IConfigurationRoot Configuration { get; }
Expand All @@ -46,7 +46,7 @@ public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(Configuration.GetConnectionString("Data:DefaultConnection:ConnectionString")));
options.UseSqlite(Configuration.GetConnectionString("SQLite")));

services.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
Expand Down

0 comments on commit 8a4d9fa

Please sign in to comment.