首页 > 解决方案 > OfflineSync azure mobile 的过度延迟 - XamarinForms

问题描述

我正在尝试提取记录并存储在本地,以支持离线功能。

但是从服务器获取记录需要太多时间,有时它没有完成同步过程。即使我尝试添加条件以仅同步少量记录但没有运气!

我们将定义表:

  public void DefineTables(MobileServiceSQLiteStore store)
    {
        //store.DefineTable<TodoItem>();

        store.DefineTable<User>();
    }

我们将通过创建查询和查询名称来提取记录:

 public async Task GetTableDetails<T>(ICloudService cloudService, Expression<Func<T, bool>> filter = null) where T : AtekMobile.Abstractions.TableData
    {
        var table = await cloudService.GetSyncTableAsync<T>();
        var query = filter != null
                    ? table.MobileServiceSyncTable.CreateQuery().Where(filter)
                    : table.MobileServiceSyncTable.CreateQuery();
        var queryName = GetQueryName<T>();
        await table.PullAsync(queryName, query);
    }

我错过了什么吗?有人遇到过这个问题吗?难道我做错了什么?如果我遗漏任何东西,请告诉我。同步记录需要很长时间。

提前致谢!

标签: azurexamarin.formsazure-mobile-services

解决方案


推荐阅读