linq2db / linq2db.EntityFrameworkCore

Bring power of Linq To DB to Entity Framework Core projects
MIT License
462 stars 38 forks source link

Support In-Memory Database #6

Closed idubnori closed 6 years ago

idubnori commented 6 years ago

Throw exception, if use UseInMemoryDatabase in Microsoft.EntityFrameworkCore.InMemory.

System.InvalidCastException: 
'Microsoft.EntityFrameworkCore.InMemory.Query.Internal.InMemoryQueryContextFactory' 
'Microsoft.EntityFrameworkCore.Query.RelationalQueryContextFactory'
sdanyliv commented 6 years ago

We do not have plans to support in-memory database. Think about linq2db usage as stored procedure execution. Main linq2db goal is to generate complex SQL and run query effectively as posssible. In-memeory database is just mock for unit testing and supports almost nothing from SQL world.

idubnori commented 6 years ago

Got it. Thank you. To throw NotSupportedException, needs to fix in linq2db side?

sdanyliv commented 6 years ago

Yes, not closing this issue to track that we have to add such exception. Thanks.

jogibear9988 commented 6 years ago

This means a special EF core in memory mode? Sqlite inmemory is supported?

idubnori commented 6 years ago

@jogibear9988 Yes. Sqlite with in-memory looks good to me. (Just checked DeleteAsync only)

sdanyliv commented 6 years ago

@idubnori, we are not EF users, so any feedback is valuable.

sdanyliv commented 6 years ago

Added more informative message instead of InvalidCastException in cf1bbf4e476e43067cd3723b221f301eb79ff258