-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (28 loc) · 1.29 KB
/
Copy pathProgram.cs
File metadata and controls
36 lines (28 loc) · 1.29 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
36
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using GitHubPagesDemo;
using BlazorBootstrap;
using GitHubPagesDemo.Data;
using GitHubPagesDemo.Interface;
using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using DocumentFormat.OpenXml.InkML;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddBlazorBootstrap();
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseInMemoryDatabase("TestDatabase"));
//builder.Services.AddDbContext<ApplicationDbContext>(options =>
// options.UseSqlite("Data Source=MyApp.db"));
builder.Services.AddScoped<IServiceFactory, ServiceFactory>();
builder.Services.AddScoped<ToastService>();
await builder.Build().RunAsync();
//var app = builder.Build();
//using (var scope = app.Services.GetRequiredService<IServiceScopeFactory>().CreateScope())
//{
// using var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
// context.Database.Migrate();
//}