Skip to content

Instantly share code, notes, and snippets.

@tanaka-takayoshi
Created February 11, 2014 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanaka-takayoshi/8931343 to your computer and use it in GitHub Desktop.
Save tanaka-takayoshi/8931343 to your computer and use it in GitHub Desktop.
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