Switching to InMemory for Mac
This commit is contained in:
@@ -19,7 +19,8 @@
|
||||
var context = (CatalogContext)applicationBuilder
|
||||
.ApplicationServices.GetService(typeof(CatalogContext));
|
||||
|
||||
context.Database.Migrate();
|
||||
// TODO: Only run this if using a real database
|
||||
// context.Database.Migrate();
|
||||
|
||||
if (!context.CatalogBrands.Any())
|
||||
{
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace Microsoft.eShopWeb
|
||||
{
|
||||
try
|
||||
{
|
||||
c.UseSqlServer(Configuration.GetConnectionString("CatalogConnection"));
|
||||
c.UseInMemoryDatabase("Catalog");
|
||||
//c.UseSqlServer(Configuration.GetConnectionString("CatalogConnection"));
|
||||
c.ConfigureWarnings(wb =>
|
||||
{
|
||||
//By default, in this application, we don't want to have client evaluations
|
||||
@@ -50,7 +51,8 @@ namespace Microsoft.eShopWeb
|
||||
|
||||
// Add Identity DbContext
|
||||
services.AddDbContext<AppIdentityDbContext>(options =>
|
||||
options.UseSqlServer(Configuration.GetConnectionString("IdentityConnection")));
|
||||
options.UseInMemoryDatabase("Identity"));
|
||||
// options.UseSqlServer(Configuration.GetConnectionString("IdentityConnection")));
|
||||
|
||||
services.AddIdentity<ApplicationUser, IdentityRole>()
|
||||
.AddEntityFrameworkStores<AppIdentityDbContext>()
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
|
||||
|
||||
Reference in New Issue
Block a user