Example #1
0
        public async Task <ICurrency> FetchCurrency(Guid guid)
        {
            using (DbDataReader reader = await dbCurrency.GetOne(guid))
            {
                if (reader.Read())
                {
                    Currency currency = new Currency();
                    LoadFromReader(reader, currency);
                    return(currency);
                }
            }

            return(null);
        }
Example #2
0
        public async Task <ICurrency> FetchCurrency(Guid guid, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            using (DbDataReader reader = await dbCurrency.GetOne(guid))
            {
                if (reader.Read())
                {
                    Currency currency = new Currency();
                    LoadFromReader(reader, currency);
                    return(currency);
                }
            }

            return(null);
        }