Ejemplo n.º 1
0
        public async Task <bool> SyncAllAsync()
        {
            var list = new List <Task <bool> >();

            list.Add(GameResultManager.SyncAsync());
            list.Add(ChallengeManager.SyncAsync());
            list.Add(MembershipManager.SyncAsync());
            list.Add(AthleteManager.SyncAsync());
            list.Add(LeagueManager.SyncAsync());

            var successes = await Task.WhenAll(list).ConfigureAwait(false);

            var count = MembershipManager.Table.ToListAsync().Result;

            return(successes.Any(x => !x));
        }
Ejemplo n.º 2
0
        public AzureService()
        {
            var url   = new Uri(Keys.AzureDomain);
            var store = new MobileServiceSQLiteStore($"{url.Host}.db");

            store.DefineTable <Athlete>();
            store.DefineTable <League>();
            store.DefineTable <Membership>();
            store.DefineTable <Challenge>();
            store.DefineTable <GameResult>();
            Client.SyncContext.InitializeAsync(store);

            LeagueManager     = new LeagueManager();
            MembershipManager = new MembershipManager();
            AthleteManager    = new AthleteManager();
            ChallengeManager  = new ChallengeManager();
            GameResultManager = new GameResultManager();
        }