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

34 lines
944 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();
6 months ago
await dbHelper.InitializeAsync<EmergencyContact>();
await dbHelper.InitializeAsync<IncidentReport>();// Asynchronously create the EmergencyContact table
6 months ago
}
catch (Exception ex)
{
Console.WriteLine($"Database initialization failed: {ex.Message}");
}
}
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell());
}
}
6 months ago
}