Distribution_GL Initialization
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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 CurrencyRepository(AppDBContext context) : ICurrencyRepository
|
||||
{
|
||||
private readonly AppDBContext _context = context;
|
||||
|
||||
public async Task<List<Currency>> GetAllAsync() =>
|
||||
await _context.Currencies
|
||||
.OrderBy(c => c.CurrencyCode)
|
||||
.ToListAsync();
|
||||
|
||||
public async Task<string> GetBaseCurrencyCodeAsync() =>
|
||||
(await _context.Currencies.FirstOrDefaultAsync(c => c.IsBaseCurrency))?.CurrencyCode ?? "LKR";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user