Userhez is lehet már NFC kódot rendelni
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using WorkFlowCheck.MAUI.Services;
|
||||
using Microsoft.Extensions.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -12,6 +11,7 @@ using Microsoft.Maui.Controls.Hosting;
|
||||
using Microsoft.Maui.Hosting;
|
||||
using CommunityToolkit.Maui.Core;
|
||||
using WorkFlowCheck.MAUI.Handlers;
|
||||
using WorkFlowCheck.MAUI.Helper;
|
||||
|
||||
namespace WorkFlowCheck.MAUI
|
||||
{
|
||||
@@ -21,27 +21,14 @@ namespace WorkFlowCheck.MAUI
|
||||
{
|
||||
var builder = MauiApp.CreateBuilder();
|
||||
builder.UseDevExpress(useLocalization: false)
|
||||
.UseDevExpressControls()
|
||||
.UseDevExpressCollectionView();
|
||||
.UseDevExpressControls()
|
||||
.UseDevExpressCollectionView();
|
||||
|
||||
builder.Services.AddAutoMapper(typeof(MapperProfile));
|
||||
// appsettings.json beállítása
|
||||
string jsonFilePath = Path.Combine(FileSystem.AppDataDirectory, "appsettings.json");
|
||||
// Másold a fájlt a Raw erőforrásokból az AppDataDirectory-ba, ha még nincs ott
|
||||
if (!File.Exists(jsonFilePath))
|
||||
{
|
||||
using var stream = FileSystem.OpenAppPackageFileAsync("appsettings.json").Result;
|
||||
using var reader = new StreamReader(stream);
|
||||
File.WriteAllText(jsonFilePath, reader.ReadToEnd());
|
||||
}
|
||||
|
||||
var configuration = new ConfigurationBuilder().SetBasePath(FileSystem.AppDataDirectory) // A konfigurációs fájl betöltése az alkalmazás adat könyvtárából
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true).Build();
|
||||
|
||||
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddDbContext<AppDbContext>();
|
||||
|
||||
builder.Services.AddSingleton<IConfiguration>(configuration);
|
||||
|
||||
builder.Services.AddSingleton<IUserService, UserService>();
|
||||
builder.Services.AddSingleton<ISyncService, SyncService>();
|
||||
builder.Services.AddSingleton<IBaseStockService, BaseStockService>();
|
||||
@@ -64,9 +51,18 @@ namespace WorkFlowCheck.MAUI
|
||||
#if DEBUG
|
||||
builder.Logging.AddDebug();
|
||||
#endif
|
||||
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await SystemHelper.GetAPIInfoAsync();
|
||||
}).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
|
||||
ServiceProvider = app.Services;
|
||||
return app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user