コード例 #1
0
ファイル: AzureService.cs プロジェクト: youngcm2/Sport
        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));
        }
コード例 #2
0
ファイル: AzureService.cs プロジェクト: youngcm2/Sport
        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();
        }