Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can EF Core work on Blazor WASM? #18908

Open
ebekker opened this issue Nov 14, 2019 · 2 comments
Open

Can EF Core work on Blazor WASM? #18908

ebekker opened this issue Nov 14, 2019 · 2 comments

Comments

@ebekker
Copy link

@ebekker ebekker commented Nov 14, 2019

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.

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Nov 15, 2019

/cc @bricelam

@bricelam

This comment has been minimized.

Copy link
Contributor

@bricelam bricelam commented Nov 15, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.