Localdb Blazor Wasm

Faheem Husain Rizvi 6 Reputation points
2022-03-31T09:47:09.233+00:00

Integrate sqlite database in .net 6 blazor wasm app at client side

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,594 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,948 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,997 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,061 Reputation points
    2022-03-31T15:16:14.497+00:00

    Blazor WASM is working on supporting the calling of other WASM libraries.

    https://learn.microsoft.com/en-us/aspnet/core/blazor/webassembly-native-dependencies?view=aspnetcore-6.0

    SqlLite has been converted to WASM with some limitations. As WASM application have no file access, it is a memory only database. The SqlLite WASM comes with some javascript to copy the in memory database to local storage.

    here is a video of Blazor WASM calling SqlLite

    https://www.youtube.com/watch?v=kesUNeBZ1Os

    note: there were some issues with the .net 6 release, don't know if they were fixed.

    while this is great technology example, I'm not use I'd use such a heavy approach. As its only an in-memory database, it seems Linq to objects would work just as well and a much simpler and more stable solution. As with the SqlLite, you cache the objects to local storage.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.