EF Setup database type of In-Memory database

154 Views Asked by At

Is it possible to setup type of in-memory database by Entity Framework? I need this In-Memory database correctly to be as Oracle SQL.

var options = new DbContextOptionsBuilder<MyDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
MyDbContext context = new(options);

Background: I'm using in-memory database in my unit tests. In real code I'm connecting to Oracle SQL and in one method I check content of string in database by Entity Framework by using function:

predicateBuilder.And(user => EF.Functions.Like(user.Name, "john"))

In my unit tests working method Like as case insensitive but in real code it's working as case sensitive. I found another question and solution for that and I know that this method Like works differently for SQL/SQLite, Oracle/Postgres..

I fixed this issue but for avoiding to have similar issues I'd like to setup in memory database be same type as my real database (for me Oracle SQL)

0

There are 0 best solutions below