summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs')
-rw-r--r--Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs b/Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs
new file mode 100644
index 0000000..1d5a24f
--- /dev/null
+++ b/Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Threading.Tasks;
+using Microsoft.WindowsAzure.MobileServices;
+using Newtonsoft.Json.Linq;
+
+namespace Xamarin.Forms.Pages.Azure
+{
+ public class AzureEasyTableSource : AzureSource
+ {
+ public static readonly BindableProperty TableNameProperty =
+ BindableProperty.Create(nameof(TableName), typeof(string), typeof(AzureEasyTableSource), null);
+
+ public string TableName
+ {
+ get { return (string)GetValue(TableNameProperty); }
+ set { SetValue(TableNameProperty, value); }
+ }
+
+ public override async Task<JToken> GetJson()
+ {
+ var mobileServiceClient = new MobileServiceClient(Uri);
+ var table = mobileServiceClient.GetTable(TableName);
+ return await table.ReadAsync(string.Empty);
+ }
+ }
+} \ No newline at end of file