SyncService + SyncPage added
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user