-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
62 lines (51 loc) · 2.17 KB
/
Program.cs
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using Blazored.LocalStorage;
using Blazored.Toast;
using BlazorPro.BlazorSize;
using BlazorStrap;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Personal_WebAssebly_App_Fh_Aachen.Interfaces;
using Personal_WebAssebly_App_Fh_Aachen.Repos;
using Personal_WebAssebly_App_Fh_Aachen.Token;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Personal_WebAssebly_App_Fh_Aachen
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// logcalstorage service here
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddTransient<IAuthenticationRepo, AuthenticationRepo>();
// same for intface Iauthor and AuthorRepo
builder.Services.AddTransient<IAuthoRepo, AuthorRepo>();
//Book store repo add here
builder.Services.AddTransient<IBookRepo, BookRepo>();
// logcalstorage service here
//Toasthere
//here is the Idetitny mdoe token jwt
builder.Services.AddScoped<TokenAuthen>();
builder.Services.AddScoped<AuthenticationStateProvider>(p =>
p.GetRequiredService<TokenAuthen>());
builder.Services.AddScoped<JwtSecurityTokenHandler>();
// here is the Implrementation for filre upload img
//builder.Services.AddTransient<IHochladen, Hochlade>();
builder.Services.AddBootstrapCss();
builder.Services.AddAuthorizationCore();
builder.Services.AddMediaQueryService();
builder.Services.AddBlazoredToast();
await builder.Build().RunAsync();
}
}
}