Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created October 16, 2018 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/6556a56b28632292dba6d32367ed2cd7 to your computer and use it in GitHub Desktop.
Save dcomartin/6556a56b28632292dba6d32367ed2cd7 to your computer and use it in GitHub Desktop.
var options = new DbContextOptionsBuilder<MyDbContext>()
.UseInMemoryDatabase(databaseName: "Test")
// Don't raise the error warning us that the in memory db doesn't support transactions
.ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))
.Options;
var dbContext = new MyDbContext(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment