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.

31 lines
922 B

1 year ago
using LocalDataStorageWithSQLite.Repositories;
using LocalDataStorageWithSQLite.Utils;
using Microsoft.Extensions.Logging;
namespace LocalDataStorageWithSQLite
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
string dbPath = FileAccessHelper.GetLocalFilePath("people.db3");
builder.Services.AddSingleton<PersonRepository>(s => ActivatorUtilities.CreateInstance<PersonRepository>(s, dbPath));
#if DEBUG
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}