Files
Distribution_GL/Repositories/SystemConfigRepository.cs

19 lines
689 B
C#

using General_Ledger_Service.Infra;
using General_Ledger_Service.Interfaces.Repositories;
using General_Ledger_Service.Models;
using Microsoft.EntityFrameworkCore;
namespace General_Ledger_Service.Repositories
{
public class SystemConfigRepository(AppDBContext context) : ISystemConfigRepository
{
private readonly AppDBContext _context = context;
public async Task<SystemConfig?> GetByKeyAsync(string configKey) =>
await _context.SystemConfigs.FirstOrDefaultAsync(c => c.ConfigKey == configKey);
public async Task<List<SystemConfig>> GetAllAsync() =>
await _context.SystemConfigs.OrderBy(c => c.ConfigKey).ToListAsync();
}
}