Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix code snippets formatting

  • Loading branch information...
commit f7b45bac55b49e0db1f0a9c7579b91eced6ac81a 1 parent 763bfa2
@ermau ermau authored
Showing with 23 additions and 20 deletions.
  1. +7 −7 component/Details.md
  2. +16 −13 component/GettingStarted.md
View
14 component/Details.md
@@ -10,13 +10,13 @@ When you create a new Mobile Service, you'll be prompted to either create a new
Once you've either created a new SQL database for your Mobile Service or connected your Mobile Service to an database, declare your data in your app and insert it using the following syntax:
```csharp
- public class Item {
- public int Id { get; set; }
- public string Text { get; set; }
- }
+public class Item {
+ public int Id { get; set; }
+ public string Text { get; set; }
+}
Item item = new Item { Text = "Awesome item" };
-App.MobileService.GetTable<Item>().InsertAsync(item)
+App.MobileService.GetTable<Item>().InsertAsync (item)
.ContinueWith (t => { /* success or failure */});
```
@@ -34,7 +34,7 @@ Copy the Client ID and Client Secret to the appropriate place in the Identity t
To allow your users to login with their Facebook credentials, for example, you'd use this code:
```csharp
-App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook)
+App.MobileService.LoginAsync (MobileServiceAuthenticationProvider.Facebook)
.ContinueWith (t => { /* t.Result is user */ });
```
@@ -48,7 +48,7 @@ To send push notifications, upload your developer certificate under the authenti
Mobile Services allows you to easily send push notifications via Apple Push Notification Services (APNS)
```js
- push.apns.send(devicetoken, { alert: "Hello to Apple World from Mobile Services!"});
+push.apns.send (devicetoken, { alert: "Hello to Apple World from Mobile Services!"});
```
You can find the full Getting Started with Push Notifications tutorial [here](http://go.microsoft.com/fwlink/?LinkId=282377).
View
29 component/GettingStarted.md
@@ -18,8 +18,9 @@ You can find the full Getting Started with Mobile Services tutorial [here]( http
After you've created a Mobile Service, use the following to connect your project:
```csharp
- using Microsoft.WindowsAzure.MobileServices;
+using Microsoft.WindowsAzure.MobileServices;
...
+
public static MobileServiceClient MobileService = new MobileServiceClient(
"https://yourMobileServiceName.azure-mobile.net/",
"YOUR_APPLICATION_KEY"
@@ -45,18 +46,20 @@ You'll then be prompted to set permissions for the table.
To store data in that table, use the following code snippet (originally from the [September 2012 announcement](http://blog.xamarin.com/xamarin-partners-with-microsoft-to-support-azure-mobile-services-on-android-and-ios/) of the Xamarin and Windows Azure partnership):
```csharp
- public class TodoItem
- {
- public int Id { get; set; }
- [DataMember (Name = "text")]
- public string Text { get; set; }
- [DataMember (Name = "complete")]
- public bool Complete { get; set; }
- }
- ...
- this.table = MobileService.GetTable<TodoItem>();
- this.table.Where (ti => !ti.Complete).ToListAsync()
- .ContinueWith (t => { this.items = t.Result; }, scheduler);
+public class TodoItem
+{
+ public int Id { get; set; }
+ [DataMember (Name = "text")]
+ public string Text { get; set; }
+ [DataMember (Name = "complete")]
+ public bool Complete { get; set; }
+}
+
+...
+
+this.table = MobileService.GetTable<TodoItem>();
+this.table.Where (ti => !ti.Complete).ToListAsync()
+ .ContinueWith (t => { this.items = t.Result; }, scheduler);
```
### Documentation
Please sign in to comment.
Something went wrong with that request. Please try again.