SyncService + SyncPage added

This commit is contained in:
Iván Szabó
2025-02-06 14:46:31 +01:00
parent b5e5158f1e
commit b233347a7d
11 changed files with 159 additions and 25 deletions
@@ -0,0 +1,31 @@
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.MAUI.DataLayer;
namespace WorkFlowCheck.MAUI.Services
{
public class BaseService
{
public readonly HttpClient _httpClient;
public readonly AppDbContext _dbContext;
public readonly IConfiguration _configuration;
public BaseService(HttpClient httpClient, IConfiguration configuration, AppDbContext dbContext)
{
_httpClient = httpClient;
_dbContext = dbContext;
_configuration = configuration;
var apiBaseUrl = configuration["ApiBaseUrl"]; // API-cím elérése a konfigurációból
_httpClient.BaseAddress = new Uri(apiBaseUrl);
var apiKey = configuration["ApiKey"];
_httpClient.DefaultRequestHeaders.Add("X-Api-Key", apiKey);
}
}
}