Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I'm exploring weather or not EF Core might work in the Blazor WASM environment.
My theory is that EF Core is a .NET Standard 2.0/2.1 compatible framework, and coupled with a provider that is likewise .NET Standard compatible and does not require any networking or file I/O features that conflict with the browser sandbox, such as the InMemory provider, then it should theoretically be possible to use EF Core "in the browser" with Blazor WASM.
To explore, this theory I created a very basic sample EF Core model and DB context to be hosted in a sample Blazor WASM app, but even very basic invocation of the framework causes low-level errors. I believe these are errors that fundamentally must be addressed by the WASM platform, which is why I have opened an issue in the mono repo, but I also wanted to inquire with the EF Core team if there are any fundamental features that EF Core relies on that would naturally not be available in a Blazor environment.
Issue 17799 in the mono repo referenced above, contains the code snippet for the basic example I'm working with.
Those clever folks working on Uno got it working in this sample on WASM. They had to build SQLite for WASM (in nventive/Uno.sqlite-wasm) and add a custom SQLitePCL.raw provider (in nventive/Uno.SQLitePCLRaw.Wasm), but it proves that it's all possible.
We're working with the Blazor team to figure out the best path forward.