Created
February 11, 2014 08:47
-
-
Save tanaka-takayoshi/8931343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.WindowsAzure.MobileServices; | |
using Newtonsoft.Json.Linq; | |
namespace MobileClient.Core | |
{ | |
public class MyClient | |
{ | |
public static MobileServiceClient MobileService = new MobileServiceClient( | |
"https://mobileapp.azure-mobile.net/", | |
"clientkey" | |
); | |
public Task<JObject> Put(MyData data) | |
{ | |
return MobileService.InvokeApiAsync<MyData, JObject>("sampleapi", data); | |
} | |
public Task<IEnumerable<MyData>> Get(string userid) | |
{ | |
return MobileService.InvokeApiAsync<IEnumerable<MyData>>("sampleapi", HttpMethod.Get, | |
new Dictionary<string, string> { { "UserId", userid} }); | |
} | |
} | |
public class MyData | |
{ | |
public string UserId { get; set; } | |
public string Text { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment