|
|
@ -10,17 +10,11 @@ using HeartTrack.Services.ActivityDataService;
|
|
|
|
using HeartTrack.Services.ReportDataService;
|
|
|
|
using HeartTrack.Services.ReportDataService;
|
|
|
|
using HeartTrack.Services.UserDataService;
|
|
|
|
using HeartTrack.Services.UserDataService;
|
|
|
|
using HeartTrack.Services.TicketDataService;
|
|
|
|
using HeartTrack.Services.TicketDataService;
|
|
|
|
using Blazorise;
|
|
|
|
|
|
|
|
using Blazorise.Bootstrap;
|
|
|
|
|
|
|
|
using Blazorise.Icons.FontAwesome;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Localization;
|
|
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
|
|
using Blazored.LocalStorage;
|
|
|
|
|
|
|
|
using HeartTrack.Services;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
|
|
|
|
|
|
using MudBlazor.Services;
|
|
|
|
using MudBlazor.Services;
|
|
|
|
|
|
|
|
using HeartTrack.Services.ActivityDataServiceFactice;
|
|
|
|
|
|
|
|
using HeartTrack.Services.ReportDataServiceFactice;
|
|
|
|
using HeartTrack.Services.TicketDataServiceFactice;
|
|
|
|
using HeartTrack.Services.TicketDataServiceFactice;
|
|
|
|
|
|
|
|
using HeartTrack.Services.UserDataServiceFactice;
|
|
|
|
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
|
@ -34,10 +28,10 @@ builder.Services.AddHttpClient();
|
|
|
|
|
|
|
|
|
|
|
|
// Add Services
|
|
|
|
// Add Services
|
|
|
|
builder.Services.AddScoped<IDataService, DataLocalService>();
|
|
|
|
builder.Services.AddScoped<IDataService, DataLocalService>();
|
|
|
|
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceAPI>();
|
|
|
|
builder.Services.AddScoped<IActivityDataService, ActivityDataServiceFactice>();
|
|
|
|
builder.Services.AddScoped<IReportDataService, ReportDataServiceAPI>();
|
|
|
|
builder.Services.AddScoped<IReportDataService, ReportDataServiceFactice>();
|
|
|
|
builder.Services.AddScoped<ITicketDataService, TicketDataServiceFactice>();
|
|
|
|
builder.Services.AddScoped<ITicketDataService, TicketDataServiceFactice>();
|
|
|
|
builder.Services.AddScoped<IUserDataService, UserDataServiceAPI>();
|
|
|
|
builder.Services.AddScoped<IUserDataService, UserDataServiceFactice>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddBlazorise()
|
|
|
|
builder.Services.AddBlazorise()
|
|
|
@ -50,34 +44,7 @@ builder.Services.AddControllers();
|
|
|
|
// Add the localization to the app and specify the resources path
|
|
|
|
// Add the localization to the app and specify the resources path
|
|
|
|
builder.Services.AddLocalization(opts => { opts.ResourcesPath = "Resources"; });
|
|
|
|
builder.Services.AddLocalization(opts => { opts.ResourcesPath = "Resources"; });
|
|
|
|
|
|
|
|
|
|
|
|
// Configure the localtization
|
|
|
|
// Configure the localization
|
|
|
|
builder.Services.Configure<RequestLocalizationOptions>(options =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Set the default culture of the web site
|
|
|
|
|
|
|
|
options.DefaultRequestCulture = new RequestCulture(new CultureInfo("en-US"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Declare the supported culture
|
|
|
|
|
|
|
|
options.SupportedCultures = new List<CultureInfo> { new CultureInfo("en-US"), new CultureInfo("fr-FR") };
|
|
|
|
|
|
|
|
options.SupportedUICultures = new List<CultureInfo> { new CultureInfo("en-US"), new CultureInfo("fr-FR") };
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddBlazoredLocalStorage();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddHttpClient();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddScoped<IDataService, DataLocalService>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
builder.Services.AddBlazorise()
|
|
|
|
|
|
|
|
.AddBootstrapProviders()
|
|
|
|
|
|
|
|
.AddFontAwesomeIcons();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the controller of the app
|
|
|
|
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the localization to the app and specify the resources path
|
|
|
|
|
|
|
|
builder.Services.AddLocalization(opts => { opts.ResourcesPath = "Resources"; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Configure the localtization
|
|
|
|
|
|
|
|
builder.Services.Configure<RequestLocalizationOptions>(options =>
|
|
|
|
builder.Services.Configure<RequestLocalizationOptions>(options =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Set the default culture of the web site
|
|
|
|
// Set the default culture of the web site
|
|
|
@ -125,4 +92,3 @@ app.MapBlazorHub();
|
|
|
|
app.MapFallbackToPage("/_Host");
|
|
|
|
app.MapFallbackToPage("/_Host");
|
|
|
|
|
|
|
|
|
|
|
|
app.Run();
|
|
|
|
app.Run();
|
|
|
|
|
|
|
|
|
|
|
|