fix
This commit is contained in:
@@ -5,10 +5,13 @@ using Models.Currencies;
|
||||
|
||||
public class CurrencyRateRepository : AppRepository<CurrencyRate>, ICurrencyRateRepository
|
||||
{
|
||||
public List<CurrencyRate> GetLastRates(Guid currencyId, int count = 1)
|
||||
public List<CurrencyRate> GetLastRates(Guid currencyId, DateTime? before = null, int count = 1)
|
||||
{
|
||||
before = before ?? DateTime.UtcNow;
|
||||
|
||||
return _context.CurrencyRates
|
||||
.Where(x => x.CurrencyId == currencyId)
|
||||
.Where(x => x.DateTime <= before)
|
||||
.OrderByDescending(x => x.DateTime)
|
||||
.ThenByDescending(x => x.Id)
|
||||
.Take(count)
|
||||
|
||||
Reference in New Issue
Block a user