-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMauiProgram.cs
More file actions
35 lines (31 loc) · 1.07 KB
/
MauiProgram.cs
File metadata and controls
35 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using JobApplicator2.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace JobApplicator2
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
builder.Services.AddScoped(sp => new HttpClient());
builder.Services.AddMauiBlazorWebView();
builder.Services.AddDbContextFactory<AppDbContext>(opt =>
opt.UseSqlite("Data Source=jobapplicator.db"));
builder.Services.AddScoped<ProfileService>();
builder.Services.AddScoped<DatabaseService>();
builder.Services.AddScoped<AiService>();
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}