public static async Task <IEnumerable <T> > WhereAsync <T>(
            this ITableDataStore <T> store, Func <T, bool> predicate)
            where T : EntityData
        {
            var items = await store.GetItemsAsync().ConfigureAwait(false);

            return(items.Where(predicate));
        }
        public SpeakersViewModel()
        {
            table = App.AzureClient.Table <Speaker>();

            Speakers           = new ObservableCollection <Speaker>();
            GetSpeakersCommand = new Command(
                async() => await GetSpeakers(),
                () => !IsBusy);
        }
        public SpeakersViewModel()
        {
            table = App.AzureClient.Table<Speaker>();

            Speakers = new ObservableCollection<Speaker>();
            GetSpeakersCommand = new Command(
                async () => await GetSpeakers(),
                () => !IsBusy);

        }
示例#4
0
        public AzureDataService(string azureMobileAppURL)
        {
            // Create Client
            var mobileService = EasyMobileServiceClient.Create();

            mobileService.Initialize(azureMobileAppURL);

            // Register the data model to create the table with
            mobileService.RegisterTable <Cache>();
            mobileService.FinalizeSchema();
            cacheTable = mobileService.Table <Cache>();
        }
示例#5
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            client = new EasyMobileServiceClient();
            client.Initialize("http://xamarin-todo-sample.azurewebsites.net");
            client.RegisterTable<ToDo>();
            client.FinalizeSchema();

            dataStore = client.Table<ToDo>();
            await dataStore.Sync();
            items = await dataStore.GetItemsAsync();
        }
示例#6
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            client = new EasyMobileServiceClient();
            client.Initialize("http://xamarin-todo-sample.azurewebsites.net");
            client.RegisterTable <ToDo>();
            client.FinalizeSchema();

            dataStore = client.Table <ToDo>();
            await dataStore.Sync();

            items = await dataStore.GetItemsAsync();
        }
示例#7
0
        public CoffeesViewModel()
        {
            // 1. Create a new EasyMobileServiceClient.
            var client = EasyMobileServiceClient.Create();

            // 2. Initialize the library with the URL of the Azure Mobile App you created in Step #1.

            client.Initialize("https://motzcoffee.azurewebsites.net");

            // 3. Register a model with the EasyMobileServiceClient to create a table.
            client.RegisterTable <Coffee>();

            // 4. Finalize the schema for our database. All table registrations must be done before this step.
            client.FinalizeSchema();

            table = client.Table <Coffee>();
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Azure.Mobile.Forms.BaseAzureViewModel`1"/> class.
 /// </summary>
 /// <param name="client">EasyMobileServiceClient for performing table operations.</param>
 public BaseAzureViewModel(IEasyMobileServiceClient client)
 {
     this.client = client;
     table       = client.Table <T>();
 }
示例#9
0
 public TableViewModel(IEasyMobileServiceClient client)
 {
     _client = client;
     _table  = client.Table <TEntity>();
 }