System.InvalidOperationException:
Relational-specific methods can only be used when the context is using a relational database provider.
Getting the above mentioned error while using InMemoryDatabase
for Test Case?
var msaContextOptions = new DbContextOptionsBuilder<MSA.DAL.MsaDbContext>()
.UseInMemoryDatabase(databaseName: "Get results")
.ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))
.Options;
As mentioned by other people I found skipping DBMigration is the best option for now. I am running Database Migration when Database ProviderName is not InMemory.
if (context.Database.ProviderName != "Microsoft.EntityFrameworkCore.InMemory")
{
context.Database.Migrate();
}