예제 #1
0
        public Task <Boolean> Login()
        {
                        #if __IOS__
            var authTask = this.kidozenApplication.Authenticate();
                        #else
            var authTask = this.kidozenApplication.Authenticate(App.AndroidContext);
#endif
            return(authTask.ContinueWith(
                       t => {
                database = kidozenApplication.ObjectSet("todo");
                return !t.IsFaulted;
            }
                       ));
        }
예제 #2
0
        public async void TestCase()
        {
            await this.kidozenApplication.Authenticate(Settings.User, Settings.Pass, Settings.Provider);

            var os             = kidozenApplication.ObjectSet("tests");
            var entityMetadata = await os.Create <MyEntity> (new MyEntity { Bar = "foo" });

            Assert.IsNotNull(entityMetadata);
            entityMetadata._metadata.sync = 3;
            var updated = new MyEntity {
                Bar = "foooo", _metadata = entityMetadata._metadata, _id = entityMetadata._id
            };
            var saved = await os.Save <MyEntity> (updated);

            Assert.IsNotNull(saved);
        }