You can find the corresponding FAQ here: this will explain to you how this is done.

Here is a working example using a simple using .NET 8:

To run:
  1. Clone or download the repository
  2. Start debugging the WebView2Ui.Desktop project

This solution current has 1 entity named Example in an in-memory database that does not persist the data on close.