I am creating unit test case using x-unit and in-memory database and i am trying to execute the below line of code
await _dbContext.Database.ExecuteSqlRawAsync(lockSql, cancellationToken);
I am getting the below error: Relational-specific methods can only be used when the context is using a relational database provider.
How do i fix this and proceed with the test case?
In-Memory Database has several issues that's why Microsoft prefers to use SQLite. In-Memory Database does not allow to run raw queries.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.