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 }); }
public async Task InsertCryptoData(ICryptoDataDomain cryptoDataDomain) { var mongoCryptoDataDomain = Mapper.Map <MongoCryptoDataDomain>(cryptoDataDomain); await _mongoCollection.InsertOneAsync(mongoCryptoDataDomain); }