public async Task Persist(NagResponseInfo state, string nagId, StorageStrategies location) { if (state == null) throw new ArgumentNullException("state"); if (string.IsNullOrEmpty(nagId)) throw new ArgumentException("nagId cannot be null or empty", "nagId"); await _fileService.WriteFileAsync<NagResponseInfo>(GetFileName(nagId), state, location); }
public async Task Persist(NagResponseInfo state, string nagId, StorageStrategies location) { if (state == null) { throw new ArgumentNullException("state"); } if (string.IsNullOrEmpty(nagId)) { throw new ArgumentException("nagId cannot be null or empty", "nagId"); } await _fileService.WriteFileAsync <NagResponseInfo>(state, GetFileName(nagId)); }
private async Task ProcessNag(Nag nag, NagResponseInfo responseInfo) { var response = await ShowNag(nag); if (response == NagResponse.Accept) { nag.NagAction(); } else if (response == NagResponse.Defer) { responseInfo.LaunchCount = 0; responseInfo.RegistrationTimeStamp = DateTimeOffset.UtcNow; } responseInfo.LastResponse = response; responseInfo.LastNag = DateTimeOffset.UtcNow; await Persist(responseInfo, nag.Id, nag.Location.ToFileServiceStrategy()); }
private async Task ProcessNag(Nag nag, NagResponseInfo responseInfo) { var response = await ShowNag(nag); if (response == NagResponse.Accept) { nag.NagAction(); } else if (response == NagResponse.Defer) { responseInfo.LaunchCount = 0; responseInfo.RegistrationTimeStamp = DateTimeOffset.UtcNow; } responseInfo.LastResponse = response; responseInfo.LastNag = DateTimeOffset.UtcNow; await Persist(responseInfo, nag.Id, nag.Location); }