22 lines
637 B
C#
22 lines
637 B
C#
using Microsoft.Extensions.Configuration;
|
|
using Pipefy.Models;
|
|
|
|
namespace Pipefy.Services
|
|
{
|
|
public class ConfigurationService : IConfigurationService
|
|
{
|
|
private readonly IConfiguration _configuration;
|
|
public ConfigurationService()
|
|
{
|
|
_configuration = new ConfigurationBuilder()
|
|
.SetBasePath(Directory.GetCurrentDirectory())
|
|
.AddJsonFile("appsettings.json", optional: false)
|
|
.Build();
|
|
}
|
|
public AppSettings GetAppSettings()
|
|
{
|
|
return _configuration.GetSection("AppSettings").Get<AppSettings>()!;
|
|
}
|
|
}
|
|
}
|