Exemple #1
0
        public async Task GetForMachine_Always_Returns_Storage_And_Inits_Cache()
        {
            var machineHistoryStorage = await _machineHistoryStorageProvider.GetForMachineAsync("key", _token);

            machineHistoryStorage.ShouldNotBeNull();
            var bytes = await _memoryDistributedCache.GetAsync("MachineHistoryStorage.key", _token);

            bytes.ShouldNotBeNull();
        }
        public async Task <IpRecord> GetLatestAsync(string machineTag, CancellationToken token)
        {
            var machineTagKey         = machineTag.ToLowerInvariant();
            var machineHistoryStorage = await _historyStorageProvider.GetForMachineAsync(machineTagKey, token).ConfigureAwait(false);

            var latest = await machineHistoryStorage.GetLatestAsync(token).ConfigureAwait(false);

            return(latest);
        }