示例#1
0
        private async void InitializeStore()
        {
            if (!SyncContext.IsInitialized)
            {
                _store = new MobileServiceSQLiteStore(_path);
                var method = typeof(MobileServiceSQLiteStoreExtensions).GetMethod("DefineTable", new[] { typeof(MobileServiceSQLiteStore) });

                foreach (var syncTablesKey in _syncTables.Keys)
                {
                    var generic = method?.MakeGenericMethod(syncTablesKey);
                    generic?.Invoke(null, new object[] { _store });
                }

                await SyncContext.InitializeAsync(_store);
            }
        }
示例#2
0
        private async Task <OperationBatch> CreateBatch()
        {
            await context.InitializeAsync();

            return(new OperationBatch(context));
        }