Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Latest commit

 

History

History
 
 

Besql

Folders and files

bit Blazor Entity Framework Sqlite (bit Besql)

Step by step walkthrough video:

bit besql video

How to use Bit.Besql:

The usage of Bit.Besql is exactly the same as the regular usage of Microsoft.EntityFrameworkCore.Sqlite with IDbContextFactory.

To get started, simply install Bit.Besql and use services.AddBesqlDbContextFactory instead of services.AddDbContextFactory. Then add the following script:

<script src="_content/Bit.Besql/bit-besql.js"></script>

Note: Do NOT use IDbContextFactory in OnInitialized method because it relies on IJSRuntime. Use OnAfterRender method instead.

In order to download sqlite db file from browser cache storage in blazor WebAssembly run the followings in browser console:

const cache = await caches.open('bit-Besql');
const resp = await cache.match('/data/cache/Offline-Client.db');
const blob = await resp.blob();
const urlToDownload = URL.createObjectURL(blob);
window.open(urlToDownload);