<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using LiteDB;
using TIKSN.Data.LiteDB;

namespace TIKSN.Finance.ForeignExchange.Data.LiteDB
{
    public class ExchangeRateRepository : LiteDbRepository<ExchangeRateEntity, Guid>, IExchangeRateRepository
    {
        public ExchangeRateRepository(ILiteDbDatabaseProvider databaseProvider) : base(databaseProvider,
            "ExchangeRates", x => new BsonValue(x))
        {
        }

        public Task<ExchangeRateEntity> GetOrDefaultAsync(
            Guid foreignExchangeID,
            string baseCurrencyCode,
            string counterCurrencyCode,
            DateTimeOffset asOn,
            CancellationToken cancellationToken)
        {
            var result = this.collection.FindOne(x =>
                x.ForeignExchangeID == foreignExchangeID && x.BaseCurrencyCode == baseCurrencyCode &&
                x.CounterCurrencyCode == counterCurrencyCode && x.AsOn == asOn);

            return Task.FromResult(result);
        }

        public Task<IReadOnlyCollection<ExchangeRateEntity>> SearchAsync(
            Guid foreignExchangeID,
            string baseCurrencyCode,
            string counterCurrencyCode,
            DateTimeOffset dateFrom,
            DateTimeOffset dateTo,
            CancellationToken cancellationToken)
        {
            var results = this.collection.Find(x =>
                x.ForeignExchangeID == foreignExchangeID && x.BaseCurrencyCode == baseCurrencyCode &&
                x.CounterCurrencyCode == counterCurrencyCode && x.AsOn >= dateFrom && x.AsOn <= dateTo);<commit_msg>Update ExchangeRateRepository.cs<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using LiteDB;
using TIKSN.Data.LiteDB;

namespace TIKSN.Finance.ForeignExchange.Data.LiteDB
{
    public class ExchangeRateRepository : LiteDbRepository<ExchangeRateEntity, Guid>, IExchangeRateRepository
    {
        public ExchangeRateRepository(ILiteDbDatabaseProvider databaseProvider) : base(databaseProvider,
            "ExchangeRates", x => new BsonValue(x))
        {
        }

        public Task<IReadOnlyCollection<ExchangeRateEntity>> SearchAsync(
            Guid foreignExchangeID,
            string baseCurrencyCode,
            string counterCurrencyCode,
            DateTimeOffset dateFrom,
            DateTimeOffset dateTo,
            CancellationToken cancellationToken)
        {
            var results = this.collection.Find(x =>
                x.ForeignExchangeID == foreignExchangeID && x.BaseCurrencyCode == baseCurrencyCode &&
                x.CounterCurrencyCode == counterCurrencyCode && x.AsOn >= dateFrom && x.AsOn <= dateTo);
{'fraction_non_alphanumeric': 0.07678571428571429, 'fraction_numerical': 0.0, 'mean_word_length': 2.8108843537414967, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '680558', 'n_tokens_mistral': 702, 'n_tokens_neox': 698, 'n_words': 142}