Exemplo n.º 1
0
        public async Task InitializeAsync()
        {
            if (MobileService?.SyncContext?.IsInitialized ?? false)
            {
                return;
            }

            MobileService = new MobileServiceClient(PCL_AppConstants.sCurrentServiceURL);
            string path = "appX007.db";

            var store = new MobileServiceSQLiteStoreWithLogging(path, PCL_AppConstants.bLogSqlLite);

            store.DefineTable <TodoItem>();
            await MobileService.SyncContext.InitializeAsync(store);

            itemsTable = MobileService.GetSyncTable <T>();
        }
Exemplo n.º 2
0
        public async Task InitializeAsync()
        {
            if (MobileService?.SyncContext?.IsInitialized ?? false)
            {
                return;
            }

            MobileService = new MobileServiceClient(PCL_AppConstants.sCurrentServiceURL)
            {
                SerializerSettings = new MobileServiceJsonSerializerSettings
                {
                    CamelCasePropertyNames = true
                }
            };

            string path = "local11.db";

            var store = new MobileServiceSQLiteStoreWithLogging(path, PCL_AppConstants.bLogSqlLite);

            store.DefineTable <T>();
            await MobileService.SyncContext.InitializeAsync(store);

            itemsTable = MobileService.GetSyncTable <T>();
        }