Beispiel #1
0
        private async Task GetSettings()
        {
            _positions = new List <Position>();
            try
            {
                //ElectionSettings
                _electionData = await BlobCache.UserAccount.GetObject <Setting>("ElectionSettings")
                                .Catch(Observable.Return(_electionData = ElectionConfigurationService.ConfigureElection()));

                await BlobCache.UserAccount.InsertObject("ElectionSettings", _electionData);

                //ElectionPositions
                _positions = await BlobCache.UserAccount.GetObject <IEnumerable <Position> >("ElectionPositions")
                             .Catch(Observable.Return(_positions = ElectionConfigurationService.GetAllPositions()));

                await BlobCache.UserAccount.InsertObject("ElectionPositions", _positions);
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, " Election Settings Error");
            }
        }