├── sqlite_stored_data.png ├── MobileAppDocDBOfflineSyncSample.iOS ├── Resources │ ├── Icon.png │ ├── Default.png │ ├── Icon-72.png │ ├── Icon@2x.png │ ├── Default@2x.png │ ├── Icon-72@2x.png │ ├── Default-568h@2x.png │ ├── Default-Portrait.png │ ├── Default-Landscape.png │ ├── Default-Portrait@2x.png │ └── Default-Landscape@2x.png ├── Main.cs ├── AppDelegate.cs ├── app.config ├── QSTodoListViewController.designer.cs ├── packages.config ├── Info.plist ├── QSTodoService.cs ├── QSTodoListViewController.cs ├── MobileAppDocDBOfflineSyncSample.iOS.csproj ├── MainStoryboard_iPad.storyboard └── MainStoryboard_iPhone.storyboard ├── MobileAppDocDBOfflineSyncSample.UWP ├── Assets │ ├── StoreLogo.png │ ├── SplashScreen.scale-200.png │ ├── LockScreenLogo.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Wide310x150Logo.scale-200.png │ └── Square44x44Logo.targetsize-24_altform-unplated.png ├── App.xaml ├── project.json ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── Package.appxmanifest ├── Common │ ├── QuickStartTask.xaml │ └── QuickStartTask.xaml.cs ├── App.xaml.cs ├── MainPage.xaml.cs ├── MobileAppDocDBOfflineSyncSample.UWP.csproj └── MainPage.xaml ├── MobileAppDocDBOfflineSyncSample.Shared ├── packages.config ├── DataModel │ ├── DoubleNestedItem.cs │ ├── NestedItem.cs │ ├── ToDoItemDocDb.cs │ └── ComplexItem.cs ├── Properties │ └── AssemblyInfo.cs └── MobileAppDocDBOfflineSyncSample.Shared.csproj ├── MobileAppDocDBOfflineSyncSample.Droid ├── Resources │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── menu │ │ └── activity_main.xml │ ├── values-v11 │ │ └── styles.xml │ ├── values-v14 │ │ └── styles.xml │ ├── values │ │ ├── Strings.xml │ │ └── styles.xml │ ├── layout │ │ ├── Row_List_To_Do.axml │ │ └── Activity_To_Do.axml │ ├── AboutResources.txt │ └── Resource.designer.cs ├── ToDoItemDocDbWrapper.cs ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Assets │ └── AboutAssets.txt ├── app.config ├── packages.config ├── ToDoItemDocDbAdapter.cs ├── XamarinMobileService.Droid.csproj.bak ├── ToDoActivity.cs └── MobileAppDocDBOfflineSyncSample.Droid.csproj ├── MobileAppDocDBOfflineSyncSample.API ├── Startup.cs ├── DataObjects │ ├── DoubleNestedItem.cs │ ├── TodoItemDocDb.cs │ ├── NestedItem.cs │ └── ComplexItem.cs ├── Helpers │ ├── DocumentResource.cs │ ├── QueryableExpandAttribute.cs │ └── DocumentDBDomainManager.cs ├── Web.Debug.config ├── Web.Release.config ├── Properties │ └── AssemblyInfo.cs ├── App_Start │ ├── Startup.Swagger.cs │ └── Startup.MobileApp.cs ├── Controllers │ ├── TodoItemDocDbController.cs │ └── ComplexItemController.cs ├── packages.config ├── Web.config └── MobileAppDocDBOfflineSyncSample.API.csproj ├── LICENSE ├── README.md ├── .gitignore └── MobileAppDocDBOfflineSyncSample.sln /sqlite_stored_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/sqlite_stored_data.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon-72.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon@2x.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Icon-72@2x.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Landscape.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Shared/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.iOS/Resources/Default-Landscape@2x.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.Droid/Resources/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karolzak/mobile-app-documentdb-offlinesync-sample/HEAD/MobileAppDocDBOfflineSyncSample.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/menu/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartup(typeof(MobileAppDocDBOfflineSyncSample.API.Startup))] 5 | 6 | namespace MobileAppDocDBOfflineSyncSample.API 7 | { 8 | public partial class Startup 9 | { 10 | public void Configuration(IAppBuilder app) 11 | { 12 | ConfigureMobileApp(app); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/App.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/DataObjects/DoubleNestedItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace MobileAppDocDBOfflineSyncSample.API.DataObjects 8 | { 9 | public class DoubleNestedItem 10 | { 11 | [JsonProperty(PropertyName = "doubleNestedBool")] 12 | public bool DoubleNestedBool { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/ToDoItemDocDbWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | using MobileAppDocDBOfflineSyncSample.Shared.DataModel; 4 | 5 | namespace MobileAppDocDBOfflineSyncSample.Droid 6 | { 7 | 8 | public class ToDoItemDocDbWrapper : Java.Lang.Object 9 | { 10 | public ToDoItemDocDbWrapper(ToDoItemDocDb item) 11 | { 12 | ToDoItem = item; 13 | } 14 | 15 | public ToDoItemDocDb ToDoItem { get; private set; } 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/values/Strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | MobileAppDocDBOfflineSyncSample 4 | Add a todo item 5 | Add 6 | Azure App Service 7 | Refresh 8 | Item Text 9 | 10 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Shared/DataModel/DoubleNestedItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace MobileAppDocDBOfflineSyncSample.Shared.DataModel 9 | { 10 | public class DoubleNestedItem 11 | { 12 | [JsonProperty(PropertyName = "doubleNestedBool")] 13 | public bool DoubleNestedBool { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/layout/Row_List_To_Do.axml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.Azure.Mobile.Client": "3.1.0", 4 | "Microsoft.Azure.Mobile.Client.SQLiteStore": "3.1.0", 5 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", 6 | "Newtonsoft.Json": "9.0.1" 7 | }, 8 | "frameworks": { 9 | "uap10.0": {} 10 | }, 11 | "runtimes": { 12 | "win10-arm": {}, 13 | "win10-arm-aot": {}, 14 | "win10-x86": {}, 15 | "win10-x86-aot": {}, 16 | "win10-x64": {}, 17 | "win10-x64-aot": {} 18 | } 19 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Foundation; 5 | using UIKit; 6 | 7 | namespace MobileAppDocDBOfflineSyncSample.iOS 8 | { 9 | public class Application 10 | { 11 | // This is the main entry point of the application. 12 | static void Main (string[] args) 13 | { 14 | // if you want to use a different Application Delegate class from "AppDelegate" 15 | // you can specify it here. 16 | UIApplication.Main (args, null, "AppDelegate"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/DataObjects/TodoItemDocDb.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Documents; 2 | using Microsoft.Azure.Mobile.Server; 3 | using Newtonsoft.Json; 4 | using MobileAppDocDBOfflineSyncSampleService.Helpers; 5 | 6 | namespace MobileAppDocDBOfflineSyncSampleService.DataObjects 7 | { 8 | public class TodoItemDocDb : DocumentResource 9 | { 10 | [JsonProperty(PropertyName = "text")] 11 | public string Text { get; set; } 12 | 13 | [JsonProperty(PropertyName = "complete")] 14 | public bool Complete { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Foundation; 5 | using UIKit; 6 | 7 | namespace MobileAppDocDBOfflineSyncSample.iOS 8 | { 9 | // The UIApplicationDelegate for the application. This class is responsible for launching the 10 | // User Interface of the application, as well as listening (and optionally responding) to 11 | // application events from iOS. 12 | [Register ("AppDelegate")] 13 | public partial class AppDelegate : UIApplicationDelegate 14 | { 15 | // class-level declarations 16 | public override UIWindow Window {get; set;} 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Shared/DataModel/NestedItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | 7 | namespace MobileAppDocDBOfflineSyncSample.Shared.DataModel 8 | { 9 | public class NestedItem 10 | { 11 | [JsonProperty(PropertyName = "nestedText")] 12 | public string NestedText { get; set; } 13 | 14 | [JsonProperty(PropertyName = "nestedBool")] 15 | public bool NestedBool { get; set; } 16 | 17 | 18 | [JsonProperty(PropertyName = "doubleNestedItem")] 19 | public DoubleNestedItem DoubleNestedItem { get; set; } 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with your package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/DataObjects/NestedItem.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Web; 6 | 7 | namespace MobileAppDocDBOfflineSyncSample.API.DataObjects 8 | { 9 | 10 | [QueryableExpand("DoubleNestedItem")] 11 | public class NestedItem 12 | { 13 | [JsonProperty(PropertyName = "nestedText")] 14 | public string NestedText { get; set; } 15 | 16 | [JsonProperty(PropertyName = "nestedBool")] 17 | public bool NestedBool { get; set; } 18 | 19 | 20 | [JsonProperty(PropertyName = "doubleNestedItem")] 21 | public DoubleNestedItem DoubleNestedItem { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/QSTodoListViewController.designer.cs: -------------------------------------------------------------------------------- 1 | // WARNING 2 | // 3 | // This file has been generated automatically by Xamarin Studio from the outlets and 4 | // actions declared in your storyboard file. 5 | // Manual changes to this file will not be maintained. 6 | // 7 | using System; 8 | using Foundation; 9 | using System.Threading.Tasks; 10 | using UIKit; 11 | using System.CodeDom.Compiler; 12 | 13 | namespace MobileAppDocDBOfflineSyncSample.iOS 14 | { 15 | [Register ("QSTodoListViewController")] 16 | public partial class QSTodoListViewController 17 | { 18 | [Outlet] 19 | UIKit.UITextField itemText { get; set; } 20 | 21 | [Action("OnAdd:")] 22 | [GeneratedCode("iOS Designer", "1.0")] 23 | partial void OnAdd(UIButton sender); 24 | 25 | void ReleaseDesignerOutlets () 26 | { 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/DataObjects/ComplexItem.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Documents; 2 | using Microsoft.Azure.Mobile.Server; 3 | using Newtonsoft.Json; 4 | using MobileAppDocDBOfflineSyncSampleService.Helpers; 5 | using MobileAppDocDBOfflineSyncSample.API.DataObjects; 6 | using System.Collections.Generic; 7 | 8 | namespace MobileAppDocDBOfflineSyncSampleService.DataObjects 9 | { 10 | public class ComplexItem : DocumentResource 11 | { 12 | [JsonProperty(PropertyName = "text")] 13 | public string Text { get; set; } 14 | 15 | [JsonProperty(PropertyName = "complete")] 16 | public bool Complete { get; set; } 17 | 18 | [JsonProperty(PropertyName ="nested")] 19 | public NestedItem Nested { get; set; } 20 | 21 | 22 | [JsonProperty(PropertyName = "nestedItems")] 23 | public ICollection NestedItems { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Shared/DataModel/ToDoItemDocDb.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace MobileAppDocDBOfflineSyncSample.Shared.DataModel 5 | { 6 | public class ToDoItemDocDb 7 | { 8 | public string Id { get; set; } 9 | 10 | [JsonProperty(PropertyName = "text")] 11 | public string Text { get; set; } 12 | 13 | [JsonProperty(PropertyName = "complete")] 14 | public bool Complete { get; set; } 15 | [JsonProperty(PropertyName = "version")] 16 | public byte[] Version { get; set; } 17 | 18 | [JsonProperty(PropertyName = "createdAt")] 19 | public DateTimeOffset? CreatedAt { get; set; } 20 | 21 | [JsonProperty(PropertyName = "updatedAt")] 22 | public DateTimeOffset? UpdatedAt { get; set; } 23 | 24 | [JsonProperty(PropertyName = "deleted")] 25 | public bool Deleted { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Helpers/DocumentResource.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Documents; 2 | using Microsoft.Azure.Mobile.Server.Tables; 3 | using Newtonsoft.Json; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace MobileAppDocDBOfflineSyncSampleService.Helpers 11 | { 12 | public abstract class DocumentResource : Document, ITableData 13 | { 14 | 15 | [JsonProperty(PropertyName = "id")] 16 | public override string Id { get; set; } 17 | 18 | [JsonProperty(PropertyName = "version")] 19 | public byte[] Version { get; set; } 20 | 21 | [JsonProperty(PropertyName = "createdAt")] 22 | public DateTimeOffset? CreatedAt { get; set; } 23 | 24 | [JsonProperty(PropertyName = "updatedAt")] 25 | public DateTimeOffset? UpdatedAt { get; set; } 26 | 27 | [JsonProperty(PropertyName = "deleted")] 28 | public bool Deleted { get; set; } 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Karol Żak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using Android.App; 4 | 5 | // Information about this assembly is defined by the following attributes. 6 | // Change them to the values specific to your project. 7 | 8 | [assembly: AssemblyTitle("MobileAppDocDBOfflineSyncSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("")] 13 | [assembly: AssemblyCopyright("billholmes")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 20 | 21 | [assembly: AssemblyVersion("1.0.0")] 22 | 23 | // The following attributes are used to specify the signing key for the assembly, 24 | // if desired. See the Mono documentation for more information about signing. 25 | 26 | //[assembly: AssemblyDelaySign(false)] 27 | //[assembly: AssemblyKeyFile("")] 28 | 29 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MobileAppDocDBOfflineSyncSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MobileAppDocDBOfflineSyncSample")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Shared/DataModel/ComplexItem.cs: -------------------------------------------------------------------------------- 1 | 2 | using Newtonsoft.Json; 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | namespace MobileAppDocDBOfflineSyncSample.Shared.DataModel 8 | { 9 | public class ComplexItem 10 | { 11 | [JsonProperty(PropertyName = "text")] 12 | public string Text { get; set; } 13 | 14 | [JsonProperty(PropertyName = "complete")] 15 | public bool Complete { get; set; } 16 | 17 | [JsonProperty(PropertyName = "nestedItems")] 18 | public ICollection NestedItems { get; set; } 19 | 20 | public string Id { get; set; } 21 | 22 | [JsonProperty(PropertyName = "nested")] 23 | public NestedItem Nested { get; set; } 24 | 25 | [JsonProperty(PropertyName = "version")] 26 | public byte[] Version { get; set; } 27 | 28 | [JsonProperty(PropertyName = "createdAt")] 29 | public DateTimeOffset? CreatedAt { get; set; } 30 | 31 | [JsonProperty(PropertyName = "updatedAt")] 32 | public DateTimeOffset? UpdatedAt { get; set; } 33 | 34 | [JsonProperty(PropertyName = "deleted")] 35 | public bool Deleted { get; set; } 36 | 37 | 38 | } 39 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Shared/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("MobileAppDocDBOfflineSyncSample.Shared")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("AkzoNobel")] 13 | [assembly: AssemblyProduct("MobileAppDocDBOfflineSyncSample.Shared")] 14 | [assembly: AssemblyCopyright("Copyright © AkzoNobel 2017")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MobileAppDocDBOfflineSyncSampleService")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MobileAppDocDBOfflineSyncSampleService")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2e8cfaa1-3743-49ef-9e21-2926ca18c058")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/App_Start/Startup.Swagger.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | 3 | using System.Web.Http.Description; 4 | 5 | using Microsoft.Azure.Mobile.Server; 6 | 7 | using Microsoft.Azure.Mobile.Server.Swagger; 8 | 9 | using Swashbuckle.Application; 10 | 11 | 12 | 13 | namespace MobileAppDocDBOfflineSyncSample.API 14 | 15 | { 16 | 17 | public partial class Startup 18 | 19 | { 20 | 21 | public static void ConfigureSwagger(HttpConfiguration config) 22 | 23 | { 24 | 25 | // Use the custom ApiExplorer that applies constraints. This prevents 26 | 27 | // duplicate routes on /api and /tables from showing in the Swagger doc. 28 | 29 | config.Services.Replace(typeof(IApiExplorer), new MobileAppApiExplorer(config)); 30 | 31 | config 32 | 33 | .EnableSwagger(c => 34 | 35 | { 36 | 37 | c.SingleApiVersion("v1", "myService"); 38 | 39 | 40 | 41 | // Tells the Swagger doc that any MobileAppController needs a 42 | 43 | // ZUMO-API-VERSION header with default 2.0.0 44 | 45 | c.OperationFilter(); 46 | 47 | 48 | 49 | // Looks at attributes on properties to decide whether they are readOnly. 50 | 51 | // Right now, this only applies to the DatabaseGeneratedAttribute. 52 | 53 | c.SchemaFilter(); 54 | 55 | }) 56 | 57 | .EnableSwaggerUi(); 58 | 59 | } 60 | 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Helpers/QueryableExpandAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net.Http; 4 | using System.Web.Http.Controllers; 5 | using System.Web.Http.Filters; 6 | 7 | public class QueryableExpandAttribute : ActionFilterAttribute 8 | { 9 | private const string ODataExpandOption = "$expand="; 10 | 11 | public QueryableExpandAttribute(string expand) 12 | { 13 | this.AlwaysExpand = expand; 14 | } 15 | 16 | public string AlwaysExpand { get; set; } 17 | 18 | public override void OnActionExecuting(HttpActionContext actionContext) 19 | { 20 | HttpRequestMessage request = actionContext.Request; 21 | string query = request.RequestUri.Query.Substring(1); 22 | var parts = query.Split('&').ToList(); 23 | bool foundExpand = false; 24 | for (int i = 0; i < parts.Count; i++) 25 | { 26 | string segment = parts[i]; 27 | if (segment.StartsWith(ODataExpandOption, StringComparison.Ordinal)) 28 | { 29 | foundExpand = true; 30 | parts[i] += "," + this.AlwaysExpand; 31 | break; 32 | } 33 | } 34 | 35 | if (!foundExpand) 36 | { 37 | parts.Add(ODataExpandOption + this.AlwaysExpand); 38 | } 39 | 40 | UriBuilder modifiedRequestUri = new UriBuilder(request.RequestUri); 41 | modifiedRequestUri.Query = string.Join("&", 42 | parts.Where(p => p.Length > 0)); 43 | request.RequestUri = modifiedRequestUri.Uri; 44 | base.OnActionExecuting(actionContext); 45 | } 46 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MobileAppDocDBOfflineSync 7 | karolzak 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | 20 | UIMainStoryboardFile 21 | MainStoryboard_iPhone 22 | UIMainStoryboardFile~ipad 23 | MainStoryboard_iPad 24 | MinimumOSVersion 25 | 7.0 26 | CFBundleIconFiles 27 | 28 | Icon-72@2x.png 29 | Icon-72.png 30 | Icon@2x.png 31 | Icon.png 32 | Default.png 33 | Default@2x.png 34 | Default-568h@2x.png 35 | Default-Landscape.png 36 | Default-Landscape@2x.png 37 | Default-Portrait.png 38 | Default-Portrait@2x.png 39 | 40 | CFBundleDisplayName 41 | MobileAppDocDBOfflineSyncSample 42 | CFBundleIdentifier 43 | net.azure-mobile.MobileAppDocDBOfflineSyncSample 44 | CFBundleVersion 45 | 1.0 46 | CFBundleShortVersionString 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.axml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable/ 12 | icon.png 13 | 14 | layout/ 15 | main.axml 16 | 17 | values/ 18 | strings.xml 19 | 20 | In order to get the build system to recognize Android resources, set the build action to 21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 22 | instead operate on resource IDs. When you compile an Android application that uses resources, 23 | the build system will package the resources for distribution and generate a class called "R" 24 | (this is an Android convention) that contains the tokens for each one of the resources 25 | included. For example, for the above Resources layout, this is what the R class would expose: 26 | 27 | public class R { 28 | public class drawable { 29 | public const int icon = 0x123; 30 | } 31 | 32 | public class layout { 33 | public const int main = 0x456; 34 | } 35 | 36 | public class strings { 37 | public const int first_string = 0xabc; 38 | public const int second_string = 0xbcd; 39 | } 40 | } 41 | 42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main 43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first 44 | string in the dictionary file values/strings.xml. 45 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Controllers/TodoItemDocDbController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Mobile.Server; 2 | using System.Configuration; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Web.Http; 6 | using System.Web.Http.Controllers; 7 | using System.Web.Http.OData; 8 | using MobileAppDocDBOfflineSyncSampleService.DataObjects; 9 | using MobileAppDocDBOfflineSyncSampleService.Helpers; 10 | 11 | namespace MobileAppDocDBOfflineSyncSampleService.Controllers 12 | { 13 | public class TodoItemDocDbController : TableController 14 | { 15 | protected override void Initialize(HttpControllerContext controllerContext) 16 | { 17 | base.Initialize(controllerContext); 18 | 19 | string collectioName = ConfigurationManager.AppSettings["todoItemCollection"]; 20 | string databaseId = ConfigurationManager.AppSettings["databaseId"]; 21 | 22 | //Using Custom Domain Manager 23 | DomainManager = new DocumentDBDomainManager(collectioName, databaseId, Request);//, Services); 24 | } 25 | 26 | 27 | public IQueryable GetAllTodoItems() 28 | { 29 | return Query(); 30 | } 31 | 32 | public SingleResult GetTodoItem(string id) 33 | { 34 | return Lookup(id); 35 | } 36 | 37 | public Task PatchTodoItem(string id, Delta patch) 38 | { 39 | return UpdateAsync(id, patch); 40 | } 41 | 42 | public async Task PostTodoItem(TodoItemDocDb item) 43 | { 44 | TodoItemDocDb current = await InsertAsync(item); 45 | return CreatedAtRoute("Tables", new { id = current.Id }, current); 46 | } 47 | 48 | public Task DeleteTodoItem(string id) 49 | { 50 | return DeleteAsync(id); 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Controllers/ComplexItemController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Mobile.Server; 2 | using System.Configuration; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Web.Http; 6 | using System.Web.Http.Controllers; 7 | using System.Web.Http.OData; 8 | using MobileAppDocDBOfflineSyncSampleService.DataObjects; 9 | using MobileAppDocDBOfflineSyncSampleService.Helpers; 10 | 11 | namespace MobileAppDocDBOfflineSyncSampleService.Controllers 12 | { 13 | public class ComplexItemController : TableController 14 | { 15 | protected override void Initialize(HttpControllerContext controllerContext) 16 | { 17 | base.Initialize(controllerContext); 18 | 19 | string collectioName = ConfigurationManager.AppSettings["complexItemCollection"]; 20 | string databaseId = ConfigurationManager.AppSettings["databaseId"]; 21 | 22 | //Using Custom Domain Manager 23 | DomainManager = new DocumentDBDomainManager(collectioName, databaseId, Request);//, Services); 24 | } 25 | 26 | 27 | [QueryableExpand("Nested")] 28 | [QueryableExpand("NestedItems")] 29 | 30 | public IQueryable GetAllTodoItems() 31 | { 32 | var q = Query(); 33 | return q; 34 | } 35 | 36 | public SingleResult GetTodoItem(string id) 37 | { 38 | return Lookup(id); 39 | } 40 | 41 | public Task PatchTodoItem(string id, Delta patch) 42 | { 43 | return UpdateAsync(id, patch); 44 | } 45 | 46 | public async Task PostTodoItem(ComplexItem item) 47 | { 48 | ComplexItem current = await InsertAsync(item); 49 | return CreatedAtRoute("Tables", new { id = current.Id }, current); 50 | } 51 | 52 | public Task DeleteTodoItem(string id) 53 | { 54 | return DeleteAsync(id); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.Droid/Resources/layout/Activity_To_Do.axml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 21 | 22 | 27 | 34 | 35 | 36 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 115 | 122 | 123 | 124 | 127 | 128 | 129 | 130 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/MainStoryboard_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 42 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.iOS/MainStoryboard_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/Helpers/DocumentDBDomainManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.Documents; 2 | using Microsoft.Azure.Documents.Client; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Net.Http; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using Microsoft.Azure.Documents.Linq; 10 | using System.Web.Http; 11 | using System.Configuration; 12 | using System.IO; 13 | using System.Net; 14 | using Newtonsoft.Json; 15 | using System.Web.Http.OData; 16 | using Microsoft.Azure.Mobile.Server.Tables; 17 | 18 | namespace MobileAppDocDBOfflineSyncSampleService.Helpers 19 | { 20 | public class DocumentDBDomainManager :IDomainManager where TDocument : DocumentResource , new() 21 | { 22 | public HttpRequestMessage Request { get; set; } 23 | //public ApiServices Services { get; set; } 24 | 25 | 26 | private string _collectionId; 27 | private string _databaseId; 28 | private Database _database; 29 | private DocumentCollection _collection; 30 | private DocumentClient _client; 31 | 32 | public DocumentDBDomainManager(string collectionId, string databaseId, HttpRequestMessage request)//, ApiServices services) 33 | { 34 | Request = request; 35 | //Services = services; 36 | _collectionId = collectionId; 37 | _databaseId = databaseId; 38 | } 39 | 40 | // public DocumentDBDomainManager(HttpRequestMessage request, ApiServices services) 41 | //{ 42 | // var attribute = typeof(TDocument).GetCustomAttributes(typeof(DocumentAttribute), true).FirstOrDefault() as DocumentAttribute; 43 | // if (attribute == null) 44 | // throw new ArgumentException("the model class must be decorated with the Document attribute"); 45 | 46 | // Request = request; 47 | // Services = services; 48 | // _collectionId = attribute.CollectionId; 49 | // _databaseId = attribute.DatabaseId; 50 | //} 51 | 52 | public async Task DeleteAsync(string id) 53 | { 54 | try 55 | { 56 | var doc = GetDocument(id); 57 | 58 | 59 | if (doc == null) 60 | { 61 | return false; 62 | } 63 | 64 | await Client.DeleteDocumentAsync(doc.SelfLink); 65 | 66 | return true; 67 | 68 | 69 | } 70 | catch (Exception ex) 71 | { 72 | //Services.Log.Error(ex); 73 | throw new HttpResponseException(System.Net.HttpStatusCode.InternalServerError); 74 | } 75 | } 76 | 77 | public Task InsertAsync(TDocument data) 78 | { 79 | try 80 | { 81 | data.CreatedAt = DateTimeOffset.UtcNow; 82 | data.UpdatedAt = DateTimeOffset.UtcNow; 83 | return Client.CreateDocumentAsync(Collection.SelfLink, data) 84 | .ContinueWith(t=> GetDocFromResponse(t)); 85 | 86 | } 87 | catch (Exception ex) 88 | { 89 | //Services.Log.Error(ex); 90 | throw new HttpResponseException(System.Net.HttpStatusCode.InternalServerError); 91 | } 92 | } 93 | private TDocument GetDocFromResponse(Task> source) 94 | { 95 | if (source.IsFaulted) 96 | { 97 | new InvalidOperationException("Parent task is faulted.",source.Exception); 98 | } 99 | 100 | return GetDocEntity(source.Result.Resource); 101 | } 102 | 103 | private TDocument GetDocEntity(Document source) 104 | { 105 | if (source == null) 106 | { 107 | new ArgumentNullException("source"); 108 | } 109 | 110 | return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source)); 111 | 112 | } 113 | 114 | public SingleResult Lookup(string id) 115 | { 116 | var qry = this.Query().Where(d => d.Id == id) 117 | .Select(d => d); 118 | 119 | var result = qry.ToList(); 120 | 121 | return SingleResult.Create(result.AsQueryable()); 122 | } 123 | 124 | public Task> LookupAsync(string id) 125 | { 126 | try 127 | { 128 | return Task>.Run(()=> Lookup(id)); 129 | 130 | } 131 | catch (Exception ex) 132 | { 133 | //Services.Log.Error(ex); 134 | throw new HttpResponseException(System.Net.HttpStatusCode.InternalServerError); 135 | } 136 | } 137 | 138 | public IQueryable Query() 139 | { 140 | try 141 | { 142 | var qry = Client 143 | .CreateDocumentQuery(Collection.DocumentsLink) 144 | .ToList() 145 | .AsQueryable(); 146 | 147 | return qry; 148 | } 149 | catch (Exception ex) 150 | { 151 | //Services.Log.Error(ex); 152 | throw new HttpResponseException(System.Net.HttpStatusCode.InternalServerError); 153 | } 154 | } 155 | 156 | public Task> QueryAsync() 157 | { 158 | throw new NotImplementedException(); 159 | } 160 | 161 | public Task UpdateAsync(string id, Delta patch) 162 | { 163 | if (id == null) 164 | { 165 | throw new ArgumentNullException("id"); 166 | } 167 | 168 | if (patch == null) 169 | { 170 | throw new ArgumentNullException("patch"); 171 | } 172 | 173 | 174 | var doc = this.GetDocument(id); 175 | if (doc == null) 176 | { 177 | //Services.Log.Error(string.Format( "Resource with id {0} not found", id)); 178 | throw new HttpResponseException(System.Net.HttpStatusCode.NotFound); 179 | } 180 | 181 | 182 | TDocument current = this.GetDocEntity(doc); 183 | 184 | patch.Patch(current); 185 | this.VerifyUpdatedKey(id, current); 186 | current.UpdatedAt = DateTimeOffset.UtcNow; 187 | 188 | try 189 | { 190 | return Client.ReplaceDocumentAsync(current.SelfLink, current) 191 | .ContinueWith(t => GetDocFromResponse(t)); 192 | } 193 | 194 | catch (Exception ex) 195 | { 196 | //Services.Log.Error(ex); 197 | throw new HttpResponseException(System.Net.HttpStatusCode.InternalServerError); 198 | } 199 | } 200 | 201 | public Task ReplaceAsync(string id, TDocument data) 202 | { 203 | 204 | if (id == null) 205 | { 206 | throw new ArgumentNullException("id"); 207 | } 208 | if (data == null) 209 | { 210 | throw new ArgumentNullException("data"); 211 | } 212 | 213 | this.VerifyUpdatedKey(id, data); 214 | data.CreatedAt = DateTimeOffset.UtcNow; 215 | 216 | try 217 | { 218 | return Client.ReplaceDocumentAsync(data.SelfLink, data) 219 | .ContinueWith(t => GetDocFromResponse(t)); 220 | } 221 | 222 | catch (Exception ex) 223 | { 224 | //Services.Log.Error(ex); 225 | throw new HttpResponseException(System.Net.HttpStatusCode.InternalServerError); 226 | } 227 | 228 | } 229 | 230 | 231 | private Document GetDocument(string id) 232 | { 233 | return Client.CreateDocumentQuery(Collection.DocumentsLink) 234 | .Where(d => d.Id == id) 235 | .AsEnumerable() 236 | .FirstOrDefault(); 237 | } 238 | private void VerifyUpdatedKey(string id, TDocument data) 239 | { 240 | if (data == null || data.Id != id) 241 | { 242 | HttpResponseMessage badKey = this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, "The keys don't match"); 243 | throw new HttpResponseException(badKey); 244 | } 245 | } 246 | 247 | #region DocumentDBClient 248 | 249 | private DocumentClient Client 250 | { 251 | get 252 | { 253 | if (_client == null) 254 | { 255 | string endpoint = ConfigurationManager.AppSettings["endpoint"]; 256 | string authKey = ConfigurationManager.AppSettings["authKey"]; 257 | Uri endpointUri = new Uri(endpoint); 258 | _client = new DocumentClient(endpointUri, authKey); 259 | } 260 | 261 | return _client; 262 | } 263 | } 264 | 265 | private DocumentCollection Collection 266 | { 267 | get 268 | { 269 | if (_collection == null) 270 | { 271 | _collection = ReadOrCreateCollection(Database.SelfLink); 272 | } 273 | 274 | return _collection; 275 | } 276 | } 277 | 278 | private Database Database 279 | { 280 | get 281 | { 282 | if (_database == null) 283 | { 284 | _database = ReadOrCreateDatabase(); 285 | } 286 | 287 | return _database; 288 | } 289 | } 290 | 291 | private DocumentCollection ReadOrCreateCollection(string databaseLink) 292 | { 293 | var col = Client.CreateDocumentCollectionQuery(databaseLink) 294 | .Where(c => c.Id == _collectionId) 295 | .AsEnumerable() 296 | .FirstOrDefault(); 297 | 298 | if (col == null) 299 | { 300 | col = Client.CreateDocumentCollectionAsync(databaseLink, new DocumentCollection { Id = _collectionId }).Result; 301 | } 302 | 303 | return col; 304 | } 305 | 306 | private Database ReadOrCreateDatabase() 307 | { 308 | var db = Client.CreateDatabaseQuery() 309 | .Where(d => d.Id == _databaseId) 310 | .AsEnumerable() 311 | .FirstOrDefault(); 312 | 313 | if (db == null) 314 | { 315 | db = Client.CreateDatabaseAsync(new Database { Id = _databaseId }).Result; 316 | } 317 | 318 | return db; 319 | } 320 | #endregion 321 | 322 | 323 | 324 | 325 | public Task> QueryAsync(System.Web.Http.OData.Query.ODataQueryOptions query) 326 | { 327 | throw new NotImplementedException(); 328 | } 329 | 330 | 331 | } 332 | 333 | } 334 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileAppDocDBOfflineSyncSample.API", "MobileAppDocDBOfflineSyncSample.API\MobileAppDocDBOfflineSyncSample.API.csproj", "{209FA716-A7AD-4095-BD70-C8710FC66FA7}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileAppDocDBOfflineSyncSample.Droid", "MobileAppDocDBOfflineSyncSample.Droid\MobileAppDocDBOfflineSyncSample.Droid.csproj", "{8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileAppDocDBOfflineSyncSample.iOS", "MobileAppDocDBOfflineSyncSample.iOS\MobileAppDocDBOfflineSyncSample.iOS.csproj", "{07F1CD1B-626F-4BE5-9840-97B44CBB94C9}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileAppDocDBOfflineSyncSample.UWP", "MobileAppDocDBOfflineSyncSample.UWP\MobileAppDocDBOfflineSyncSample.UWP.csproj", "{843213BD-FBDB-43C7-8523-F6FF2293FB61}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileAppDocDBOfflineSyncSample.Shared", "MobileAppDocDBOfflineSyncSample.Shared\MobileAppDocDBOfflineSyncSample.Shared.csproj", "{A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}" 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Debug|ARM = Debug|ARM 20 | Debug|iPhone = Debug|iPhone 21 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 22 | Debug|x64 = Debug|x64 23 | Debug|x86 = Debug|x86 24 | Release|Any CPU = Release|Any CPU 25 | Release|ARM = Release|ARM 26 | Release|iPhone = Release|iPhone 27 | Release|iPhoneSimulator = Release|iPhoneSimulator 28 | Release|x64 = Release|x64 29 | Release|x86 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|ARM.ActiveCfg = Debug|Any CPU 35 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|ARM.Build.0 = Debug|Any CPU 36 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|iPhone.ActiveCfg = Debug|Any CPU 37 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|iPhone.Build.0 = Debug|Any CPU 38 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 39 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 40 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|x64.Build.0 = Debug|Any CPU 42 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|x86.ActiveCfg = Debug|Any CPU 43 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|x86.Build.0 = Debug|Any CPU 44 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|ARM.ActiveCfg = Release|Any CPU 47 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|ARM.Build.0 = Release|Any CPU 48 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|iPhone.ActiveCfg = Release|Any CPU 49 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|iPhone.Build.0 = Release|Any CPU 50 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 51 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 52 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|x64.ActiveCfg = Release|Any CPU 53 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|x64.Build.0 = Release|Any CPU 54 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|x86.ActiveCfg = Release|Any CPU 55 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|x86.Build.0 = Release|Any CPU 56 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 59 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|ARM.ActiveCfg = Debug|Any CPU 60 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|ARM.Build.0 = Debug|Any CPU 61 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|ARM.Deploy.0 = Debug|Any CPU 62 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|iPhone.ActiveCfg = Debug|Any CPU 63 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|iPhone.Build.0 = Debug|Any CPU 64 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|iPhone.Deploy.0 = Debug|Any CPU 65 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 66 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 67 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU 68 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|x64.ActiveCfg = Debug|Any CPU 69 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|x64.Build.0 = Debug|Any CPU 70 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|x64.Deploy.0 = Debug|Any CPU 71 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|x86.ActiveCfg = Debug|Any CPU 72 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|x86.Build.0 = Debug|Any CPU 73 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Debug|x86.Deploy.0 = Debug|Any CPU 74 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|Any CPU.ActiveCfg = Release|Any CPU 75 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|Any CPU.Build.0 = Release|Any CPU 76 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|Any CPU.Deploy.0 = Release|Any CPU 77 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|ARM.ActiveCfg = Release|Any CPU 78 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|ARM.Build.0 = Release|Any CPU 79 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|ARM.Deploy.0 = Release|Any CPU 80 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|iPhone.ActiveCfg = Release|Any CPU 81 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|iPhone.Build.0 = Release|Any CPU 82 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|iPhone.Deploy.0 = Release|Any CPU 83 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 84 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 85 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU 86 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|x64.ActiveCfg = Release|Any CPU 87 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|x64.Build.0 = Release|Any CPU 88 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|x64.Deploy.0 = Release|Any CPU 89 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|x86.ActiveCfg = Release|Any CPU 90 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|x86.Build.0 = Release|Any CPU 91 | {8E1FCCF4-1FA7-4C23-86B0-19C78B155AA3}.Release|x86.Deploy.0 = Release|Any CPU 92 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|Any CPU.ActiveCfg = Debug|iPhone 93 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator 94 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhone.ActiveCfg = Debug|iPhone 95 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhone.Build.0 = Debug|iPhone 96 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 97 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 98 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator 99 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator 100 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|Any CPU.ActiveCfg = Release|iPhone 101 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|ARM.ActiveCfg = Release|iPhoneSimulator 102 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhone.ActiveCfg = Release|iPhone 103 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhone.Build.0 = Release|iPhone 104 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 105 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 106 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|x64.ActiveCfg = Release|iPhoneSimulator 107 | {07F1CD1B-626F-4BE5-9840-97B44CBB94C9}.Release|x86.ActiveCfg = Release|iPhoneSimulator 108 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|Any CPU.ActiveCfg = Debug|x86 109 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|Any CPU.Build.0 = Debug|x86 110 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|Any CPU.Deploy.0 = Debug|x86 111 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|ARM.ActiveCfg = Debug|ARM 112 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|ARM.Build.0 = Debug|ARM 113 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|ARM.Deploy.0 = Debug|ARM 114 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|iPhone.ActiveCfg = Debug|x86 115 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86 116 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|iPhoneSimulator.Build.0 = Debug|x86 117 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|iPhoneSimulator.Deploy.0 = Debug|x86 118 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|x64.ActiveCfg = Debug|x64 119 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|x64.Build.0 = Debug|x64 120 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|x64.Deploy.0 = Debug|x64 121 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|x86.ActiveCfg = Debug|x86 122 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|x86.Build.0 = Debug|x86 123 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Debug|x86.Deploy.0 = Debug|x86 124 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|Any CPU.ActiveCfg = Release|x86 125 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|ARM.ActiveCfg = Release|ARM 126 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|ARM.Build.0 = Release|ARM 127 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|ARM.Deploy.0 = Release|ARM 128 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|iPhone.ActiveCfg = Release|x86 129 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|iPhoneSimulator.ActiveCfg = Release|x86 130 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|iPhoneSimulator.Build.0 = Release|x86 131 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|iPhoneSimulator.Deploy.0 = Release|x86 132 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|x64.ActiveCfg = Release|x64 133 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|x64.Build.0 = Release|x64 134 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|x64.Deploy.0 = Release|x64 135 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|x86.ActiveCfg = Release|x86 136 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|x86.Build.0 = Release|x86 137 | {843213BD-FBDB-43C7-8523-F6FF2293FB61}.Release|x86.Deploy.0 = Release|x86 138 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 139 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|Any CPU.Build.0 = Debug|Any CPU 140 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|ARM.ActiveCfg = Debug|Any CPU 141 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|ARM.Build.0 = Debug|Any CPU 142 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|iPhone.ActiveCfg = Debug|Any CPU 143 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|iPhone.Build.0 = Debug|Any CPU 144 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 145 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 146 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|x64.ActiveCfg = Debug|Any CPU 147 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|x64.Build.0 = Debug|Any CPU 148 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|x86.ActiveCfg = Debug|Any CPU 149 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Debug|x86.Build.0 = Debug|Any CPU 150 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|Any CPU.ActiveCfg = Release|Any CPU 151 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|Any CPU.Build.0 = Release|Any CPU 152 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|ARM.ActiveCfg = Release|Any CPU 153 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|ARM.Build.0 = Release|Any CPU 154 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|iPhone.ActiveCfg = Release|Any CPU 155 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|iPhone.Build.0 = Release|Any CPU 156 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 157 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 158 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|x64.ActiveCfg = Release|Any CPU 159 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|x64.Build.0 = Release|Any CPU 160 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|x86.ActiveCfg = Release|Any CPU 161 | {A37F4160-6F2D-433E-A5F3-29AC70BFBAF7}.Release|x86.Build.0 = Release|Any CPU 162 | EndGlobalSection 163 | GlobalSection(SolutionProperties) = preSolution 164 | HideSolutionNode = FALSE 165 | EndGlobalSection 166 | GlobalSection(MonoDevelopProperties) = preSolution 167 | StartupItem = MobileAppDocDBOfflineSyncSample\MobileAppDocDBOfflineSyncSample.csproj 168 | EndGlobalSection 169 | EndGlobal 170 | -------------------------------------------------------------------------------- /MobileAppDocDBOfflineSyncSample.API/MobileAppDocDBOfflineSyncSample.API.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 2.0 8 | {209FA716-A7AD-4095-BD70-C8710FC66FA7} 9 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 10 | Library 11 | Properties 12 | MobileAppDocDBOfflineSyncSample.API 13 | MobileAppDocDBOfflineSyncSample.API 14 | v4.6 15 | false 16 | true 17 | 44363 18 | 19 | 20 | 21 | true 22 | 10.0 23 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 24 | ..\ 25 | 26 | 27 | 28 | 29 | 30 | 31 | true 32 | full 33 | false 34 | bin\ 35 | DEBUG;TRACE 36 | prompt 37 | 4 38 | AnyCPU 39 | 40 | 41 | pdbonly 42 | true 43 | bin\ 44 | TRACE 45 | prompt 46 | 4 47 | 48 | 49 | 50 | 51 | 52 | True 53 | True 54 | 50010 55 | / 56 | http://localhost:50010/ 57 | False 58 | False 59 | 60 | 61 | False 62 | 63 | 64 | 65 | 66 | 67 | 68 | ..\packages\Microsoft.Azure.DocumentDB.1.10.0\lib\net45\Microsoft.Azure.Documents.Client.dll 69 | True 70 | 71 | 72 | ..\packages\Microsoft.Azure.Mobile.Server.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.dll 73 | True 74 | 75 | 76 | ..\packages\Microsoft.Azure.Mobile.Server.Swagger.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Swagger.dll 77 | True 78 | 79 | 80 | ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll 81 | 82 | 83 | ..\packages\Microsoft.Azure.Mobile.Server.Authentication.1.1.157.1\lib\net45\Microsoft.Azure.Mobile.Server.Authentication.dll 84 | 85 | 86 | ..\packages\Microsoft.Azure.Mobile.Server.Entity.1.1.157.1\lib\net45\Microsoft.Azure.Mobile.Server.Entity.dll 87 | 88 | 89 | ..\packages\Microsoft.Azure.Mobile.Server.Home.1.1.157.1\lib\net45\Microsoft.Azure.Mobile.Server.Home.dll 90 | 91 | 92 | ..\packages\Microsoft.Azure.Mobile.Server.Notifications.1.1.157.1\lib\net45\Microsoft.Azure.Mobile.Server.Notifications.dll 93 | 94 | 95 | ..\packages\Microsoft.Azure.Mobile.Server.Quickstart.1.1.157.1\lib\net45\Microsoft.Azure.Mobile.Server.Quickstart.dll 96 | 97 | 98 | ..\packages\Microsoft.Azure.Mobile.Server.Tables.1.1.157.1\lib\net45\Microsoft.Azure.Mobile.Server.Tables.dll 99 | 100 | 101 | ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll 102 | 103 | 104 | ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll 105 | 106 | 107 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 108 | True 109 | 110 | 111 | ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll 112 | True 113 | 114 | 115 | ..\packages\Swashbuckle.Core.5.5.3\lib\net40\Swashbuckle.Core.dll 116 | True 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | False 125 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll 126 | 127 | 128 | ..\packages\Microsoft.AspNet.WebApi.OData.5.5.1\lib\net45\System.Web.Http.OData.dll 129 | 130 | 131 | ..\packages\Microsoft.Azure.NotificationHubs.1.0.2\lib\net45-full\Microsoft.Azure.NotificationHubs.dll 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll 141 | 142 | 143 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 144 | 145 | 146 | ..\packages\Owin.1.0\lib\net40\Owin.dll 147 | 148 | 149 | ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll 150 | 151 | 152 | ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll 153 | 154 | 155 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll 156 | 157 | 158 | ..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.205111437\lib\net45\System.IdentityModel.Tokens.Jwt.dll 159 | 160 | 161 | ..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.dll 162 | 163 | 164 | ..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.Net4.dll 165 | 166 | 167 | ..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll 168 | 169 | 170 | ..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll 171 | 172 | 173 | ..\packages\System.Spatial.5.6.4\lib\net40\System.Spatial.dll 174 | 175 | 176 | ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll 177 | 178 | 179 | ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll 180 | True 181 | 182 | 183 | 184 | ..\packages\WebActivatorEx.2.0\lib\net40\WebActivatorEx.dll 185 | True 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | Web.config 211 | 212 | 213 | Web.config 214 | 215 | 216 | Designer 217 | 218 | 219 | 220 | 221 | {a37f4160-6f2d-433e-a5f3-29ac70bfbaf7} 222 | MobileAppDocDBOfflineSyncSample.Shared 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 238 | 239 | 240 | 241 | --------------------------------------------------------------------------------