diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-04-27 14:48:28 -0400 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-04-27 14:48:28 -0400 |
commit | 8a00a96ffb34058bfb03f8cc16c28b38a79791a4 (patch) | |
tree | 294842819c3b051e9b4050971475fda48431f109 /Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs | |
parent | 2d9288eee6e6f197364a64308183725e7bd561f9 (diff) | |
download | xamarin-forms-8a00a96ffb34058bfb03f8cc16c28b38a79791a4.tar.gz xamarin-forms-8a00a96ffb34058bfb03f8cc16c28b38a79791a4.tar.bz2 xamarin-forms-8a00a96ffb34058bfb03f8cc16c28b38a79791a4.zip |
Azure support (#143)
* Initial import of azure support for pages
* Add nuspec for azure
* move azure nuspec to correct location
* Update Newtonsoft.Json to 6.0.4
* Add converters
* Fix package
Diffstat (limited to 'Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs')
-rw-r--r-- | Xamarin.Forms.Pages.Azure/AzureEasyTableSource.cs | 26 |
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 00000000..1d5a24f0 --- /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 |