You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Seekers/App.xaml.cs

33 lines
879 B

6 months ago
using Justice.Helpers;
using Justice.Models;
namespace Justice
{
public partial class App : Application
{
public App()
{
InitializeComponent();
6 months ago
InitializeDatabaseAsync(); // Call the async method to initialize the database
}
private async void InitializeDatabaseAsync()
{
try
{
var dbHelper = new DatabaseHelper();
await dbHelper.InitializeAsync<EmergencyContact>(); // Asynchronously create the EmergencyContact table
}
catch (Exception ex)
{
Console.WriteLine($"Database initialization failed: {ex.Message}");
}
}
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell());
}
}
6 months ago
}