コード例 #1
0
        public async Task UpdateCryptoData(string tickerSymbol, ICryptoDataDomain cryptoDataDomain)
        {
            var mongoCryptoDataDomain = (MongoCryptoDataDomain)cryptoDataDomain;

            mongoCryptoDataDomain.LastModified = DateTime.UtcNow;

            var updatedCryptoData = await _mongoCollection.ReplaceOneAsync <MongoCryptoDataDomain>(u => u.Symbol.Equals(tickerSymbol), mongoCryptoDataDomain, new ReplaceOptions { IsUpsert = true });
        }
コード例 #2
0
 public async Task InsertCryptoData(ICryptoDataDomain cryptoDataDomain)
 {
     var mongoCryptoDataDomain = Mapper.Map <MongoCryptoDataDomain>(cryptoDataDomain);
     await _mongoCollection.InsertOneAsync(mongoCryptoDataDomain);
 }