private async Task ReadPropertiesFromLocalStorageAsync() { if (ServiceInstance == null) { ServiceInstance = await _localObjectStore.ReadAsync <HealthServiceInstance>(ServiceInstanceKey).ConfigureAwait(false); } if (ApplicationCreationInfo == null) { ApplicationCreationInfo = await _localObjectStore.ReadAsync <ApplicationCreationInfo>(ApplicationCreationInfoKey).ConfigureAwait(false); } if (SessionCredential == null) { SessionCredential = await _localObjectStore.ReadAsync <SessionCredential>(SessionCredentialKey).ConfigureAwait(false); } if (_personInfo == null) { _personInfo = await _localObjectStore.ReadAsync <PersonInfo>(PersonInfoKey).ConfigureAwait(false); } }
private void SetupLocalStore() { var serviceInstance = new HealthServiceInstance { Id = "1", Name = "US", Description = "US instance", HealthServiceUrl = new Uri("https://platform.healthvault-ppe.com/platform/wildcat.ashx"), ShellUrl = new Uri("https://account.healthvault-ppe.com/") }; var applicationCreationInfo = new ApplicationCreationInfo { AppInstanceId = new Guid(ApplicationInstanceId), SharedSecret = ApplicationSharedSecret, AppCreationToken = ApplicationCreationToken }; var sessionCredential = new SessionCredential { Token = SessionToken, SharedSecret = SessionSharedSecret, ExpirationUtc = DateTimeOffset.UtcNow.AddHours(4) }; var personInfo = new PersonInfo { PersonId = PersonId }; _subLocalObjectStore .ReadAsync <HealthServiceInstance>(HealthVaultSodaConnection.ServiceInstanceKey) .Returns(serviceInstance); _subLocalObjectStore .ReadAsync <ApplicationCreationInfo>(HealthVaultSodaConnection.ApplicationCreationInfoKey) .Returns(applicationCreationInfo); _subLocalObjectStore .ReadAsync <SessionCredential>(HealthVaultSodaConnection.SessionCredentialKey) .Returns(sessionCredential); _subLocalObjectStore .ReadAsync <PersonInfo>(HealthVaultSodaConnection.PersonInfoKey) .Returns(personInfo); }