Closed pekspro closed 5 years ago
@HaoK
I think this behavior might be by design, @ajcvickers can you confirm?
It appears that you need to use a static database name for it to work across requests:
services.AddDbContext<ApplicationDbContext>(options =>
options.UseInMemoryDatabase("identity"));
This works for me, but your new guid name didn't work for me either
@HaoK Yep. The same database name needs to be used for saving and querying.
😳 That so obvious! I don’t get how I could miss that. Thanks for the answer.
In startup.cs replace:
services.AddDbContext(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
with
Run the application and register an account. Logout and try to login with the created account. This will fail.
It looks like nothing is written in the Users-table when an account is registered.
I know there are some limitations when using an in-memory database, but shouldn’t this work? If it’s not supported I would prefer an exception than the current behavior.