20140419 xamarin zumo

424 views

Published on

C# で全部書こう!XamarinでZUMO (Azure Mobile Services)

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
424
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

20140419 xamarin zumo

  1. 1. 仕事 個人活動 http://bit.ly/metrotokyo4 http://tech.tanaka733.net
  2. 2. Microsoft
  3. 3. • 基本無料プラン
  4. 4. WindowsAzure.MobileServices PCLとして共通化 • プラットフォームごとのライブラリ
  5. 5. public static MobileServiceClient MobileService = new MobileServiceClient( "https://xamarinazure.azure-mobile.net/", “HogeMogeApplcationKey" ); private async Task TestAsync() { var res = await MobileService.InvokeApiAsync<string>("test"); // textBox.Text = res; }
  6. 6. ブログ記事 public class TodoItemController : TableController<TodoItem> { protected override void Initialize(HttpControllerContext controllerContext) { base.Initialize(controllerContext); var context = new XamarinAzureServiceContext(Services.Settings.Schema); DomainManager = new EntityDomainManager<TodoItem>(context, Request, Services); } // GET tables/TodoItem public IQueryable<TodoItem> GetAllTodoItems() { return Query(); }
  7. 7. AuthorizeLevel 属性で認証レベルを制御 public class TestController : ApiController { public ApiServices Services { get; set; } // GET api/Test [AuthorizeLevel(AuthorizationLevel.Anonymous)] public string Get() { Services.Log.Info("Hello from custom controller!"); return "Hello"; } }
  8. 8. public class SampleJob : ScheduledJob { public override Task ExecuteAsync() { Services.Log.Info("Hello from scheduled job!"); return Task.FromResult(true); } }

×