diff --git a/EntityFrameworkWithXamarin.Core/project.json b/EntityFrameworkWithXamarin.Core/project.json
index cf93b12..23c8ce9 100644
--- a/EntityFrameworkWithXamarin.Core/project.json
+++ b/EntityFrameworkWithXamarin.Core/project.json
@@ -1,9 +1,9 @@
{
"supports": {},
"dependencies": {
- "Microsoft.EntityFrameworkCore.Sqlite": "1.1.0",
+ "Microsoft.EntityFrameworkCore.Sqlite": "1.1.2",
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
- "NETStandard.Library": "1.6.0"
+ "NETStandard.Library": "1.6.1"
},
"frameworks": {
"netstandard1.3": {}
diff --git a/EntityFrameworkWithXamarin.Droid/EntityFrameworkWithXamarin.Droid.csproj b/EntityFrameworkWithXamarin.Droid/EntityFrameworkWithXamarin.Droid.csproj
index 5fbb06b..aede5b4 100644
--- a/EntityFrameworkWithXamarin.Droid/EntityFrameworkWithXamarin.Droid.csproj
+++ b/EntityFrameworkWithXamarin.Droid/EntityFrameworkWithXamarin.Droid.csproj
@@ -45,53 +45,41 @@
-
- ..\packages\Microsoft.Data.Sqlite.1.1.0\lib\netstandard1.3\Microsoft.Data.Sqlite.dll
- True
+
+ ..\packages\Microsoft.Data.Sqlite.1.1.1\lib\netstandard1.3\Microsoft.Data.Sqlite.dll
-
- ..\packages\Microsoft.EntityFrameworkCore.1.1.0\lib\netstandard1.3\Microsoft.EntityFrameworkCore.dll
- True
+
+ ..\packages\Microsoft.EntityFrameworkCore.1.1.2\lib\netstandard1.3\Microsoft.EntityFrameworkCore.dll
-
- ..\packages\Microsoft.EntityFrameworkCore.Relational.1.1.0\lib\netstandard1.3\Microsoft.EntityFrameworkCore.Relational.dll
- True
+
+ ..\packages\Microsoft.EntityFrameworkCore.Relational.1.1.2\lib\netstandard1.3\Microsoft.EntityFrameworkCore.Relational.dll
-
- ..\packages\Microsoft.EntityFrameworkCore.Sqlite.1.1.0\lib\netstandard1.3\Microsoft.EntityFrameworkCore.Sqlite.dll
- True
+
+ ..\packages\Microsoft.EntityFrameworkCore.Sqlite.1.1.2\lib\netstandard1.3\Microsoft.EntityFrameworkCore.Sqlite.dll
-
- ..\packages\Microsoft.Extensions.Caching.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.Caching.Abstractions.dll
- True
+
+ ..\packages\Microsoft.Extensions.Caching.Abstractions.1.1.2\lib\netstandard1.0\Microsoft.Extensions.Caching.Abstractions.dll
-
- ..\packages\Microsoft.Extensions.Caching.Memory.1.1.0\lib\netstandard1.3\Microsoft.Extensions.Caching.Memory.dll
- True
+
+ ..\packages\Microsoft.Extensions.Caching.Memory.1.1.2\lib\netstandard1.3\Microsoft.Extensions.Caching.Memory.dll
-
- ..\packages\Microsoft.Extensions.DependencyInjection.1.1.0\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll
- True
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.1.1.1\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll
-
- ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
- True
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.1\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
-
- ..\packages\Microsoft.Extensions.Logging.1.1.0\lib\netstandard1.1\Microsoft.Extensions.Logging.dll
- True
+
+ ..\packages\Microsoft.Extensions.Logging.1.1.2\lib\netstandard1.1\Microsoft.Extensions.Logging.dll
-
- ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.0\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll
- True
+
+ ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.2\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll
-
- ..\packages\Microsoft.Extensions.Options.1.1.0\lib\netstandard1.0\Microsoft.Extensions.Options.dll
- True
+
+ ..\packages\Microsoft.Extensions.Options.1.1.2\lib\netstandard1.0\Microsoft.Extensions.Options.dll
-
- ..\packages\Microsoft.Extensions.Primitives.1.1.0\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll
- True
+
+ ..\packages\Microsoft.Extensions.Primitives.1.1.1\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll
@@ -101,17 +89,15 @@
- ..\packages\System.Collections.Immutable.1.3.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll
+ ..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll
True
-
- ..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll
- True
+
+ ..\packages\System.Diagnostics.DiagnosticSource.4.3.1\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll
-
- ..\packages\System.Interactive.Async.3.0.0\lib\netstandard1.0\System.Interactive.Async.dll
- True
+
+ ..\packages\System.Interactive.Async.3.1.1\lib\netstandard1.3\System.Interactive.Async.dll
@@ -128,6 +114,7 @@
+
diff --git a/EntityFrameworkWithXamarin.Droid/app.config b/EntityFrameworkWithXamarin.Droid/app.config
new file mode 100644
index 0000000..5591050
--- /dev/null
+++ b/EntityFrameworkWithXamarin.Droid/app.config
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.Droid/packages.config b/EntityFrameworkWithXamarin.Droid/packages.config
index 9040bd3..4d0e7b2 100644
--- a/EntityFrameworkWithXamarin.Droid/packages.config
+++ b/EntityFrameworkWithXamarin.Droid/packages.config
@@ -1,18 +1,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -21,18 +21,18 @@
-
+
-
+
-
+
@@ -41,7 +41,7 @@
-
+
diff --git a/EntityFrameworkWithXamarin.MigrationsBait/EntityFrameworkWithXamarin.MigrationsBait.csproj b/EntityFrameworkWithXamarin.MigrationsBait/EntityFrameworkWithXamarin.MigrationsBait.csproj
new file mode 100644
index 0000000..d854d89
--- /dev/null
+++ b/EntityFrameworkWithXamarin.MigrationsBait/EntityFrameworkWithXamarin.MigrationsBait.csproj
@@ -0,0 +1,24 @@
+
+
+
+ netcoreapp1.0
+ EntityFrameworkWithXamarin.MigrationsBait
+ Exe
+ EntityFrameworkWithXamarin.MigrationsBait
+ 1.1.1
+ $(PackageTargetFallback);dnxcore50
+ false
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EntityFrameworkWithXamarin.MigrationsBait/EntityFrameworkWithXamarin.MigrationsBait.xproj b/EntityFrameworkWithXamarin.MigrationsBait/EntityFrameworkWithXamarin.MigrationsBait.xproj
deleted file mode 100644
index 33c9749..0000000
--- a/EntityFrameworkWithXamarin.MigrationsBait/EntityFrameworkWithXamarin.MigrationsBait.xproj
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
-
-
- a970ce65-69e6-4cc0-a34e-ed87da7ef515
- EntityFrameworkWithXamarin.MigrationsBait
- .\obj
- .\bin\
- v4.5.2
-
-
-
- 2.0
-
-
-
diff --git a/EntityFrameworkWithXamarin.MigrationsBait/project.json b/EntityFrameworkWithXamarin.MigrationsBait/project.json
deleted file mode 100644
index 08916a3..0000000
--- a/EntityFrameworkWithXamarin.MigrationsBait/project.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "version": "1.0.0-*",
- "buildOptions": {
- "emitEntryPoint": true
- },
- "dependencies": {
- "Microsoft.EntityFrameworkCore": "1.1.0",
- "Microsoft.EntityFrameworkCore.Sqlite": "1.1.0",
- "Microsoft.NETCore.App": {
- "type": "platform",
- "version": "1.1.0"
- }
- },
- "frameworks": {
- "netcoreapp1.0": {
- "imports": "dnxcore50"
- }
- },
- "tools": {
- "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final"
- }
-}
diff --git a/EntityFrameworkWithXamarin.iOS/AppDelegate.cs b/EntityFrameworkWithXamarin.iOS/AppDelegate.cs
new file mode 100644
index 0000000..6121211
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/AppDelegate.cs
@@ -0,0 +1,61 @@
+using Foundation;
+using UIKit;
+
+namespace EntityFrameworkWithXamarin.iOS
+{
+ // The UIApplicationDelegate for the application. This class is responsible for launching the
+ // User Interface of the application, as well as listening (and optionally responding) to
+ // application events from iOS.
+ [Register("AppDelegate")]
+ public class AppDelegate : UIApplicationDelegate
+ {
+ // class-level declarations
+
+ public override UIWindow Window
+ {
+ get;
+ set;
+ }
+
+ public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
+ {
+ System.Diagnostics.Debug.WriteLine("AppDelegate.FinishedLaunching()");
+
+ // Override point for customization after application launch.
+ // If not required for your application you can safely delete this method
+
+ return true;
+ }
+
+ public override void OnResignActivation(UIApplication application)
+ {
+ // Invoked when the application is about to move from active to inactive state.
+ // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
+ // or when the user quits the application and it begins the transition to the background state.
+ // Games should use this method to pause the game.
+ }
+
+ public override void DidEnterBackground(UIApplication application)
+ {
+ // Use this method to release shared resources, save user data, invalidate timers and store the application state.
+ // If your application supports background exection this method is called instead of WillTerminate when the user quits.
+ }
+
+ public override void WillEnterForeground(UIApplication application)
+ {
+ // Called as part of the transiton from background to active state.
+ // Here you can undo many of the changes made on entering the background.
+ }
+
+ public override void OnActivated(UIApplication application)
+ {
+ // Restart any tasks that were paused (or not yet started) while the application was inactive.
+ // If the application was previously in the background, optionally refresh the user interface.
+ }
+
+ public override void WillTerminate(UIApplication application)
+ {
+ // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
+ }
+ }
+}
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/Entitlements.plist b/EntityFrameworkWithXamarin.iOS/Entitlements.plist
new file mode 100644
index 0000000..24c3103
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/Entitlements.plist
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/EntityFrameworkWithXamarin.iOS/EntityFrameworkWithXamarin.iOS.csproj b/EntityFrameworkWithXamarin.iOS/EntityFrameworkWithXamarin.iOS.csproj
new file mode 100644
index 0000000..40fa373
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/EntityFrameworkWithXamarin.iOS.csproj
@@ -0,0 +1,183 @@
+
+
+
+ Debug
+ iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}
+ {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ Exe
+ EntityFrameworkWithXamarin.iOS
+ Resources
+ EntityFrameworkWithXamarin.iOS
+
+
+ true
+ full
+ false
+ bin\iPhoneSimulator\Debug
+ DEBUG
+ prompt
+ 4
+ false
+ x86_64
+ SdkOnly
+ true
+ --xml=${ProjectDir}/LinkDescription.xml
+
+
+ none
+ true
+ bin\iPhoneSimulator\Release
+ prompt
+ 4
+ SdkOnly
+ x86_64
+ false
+ --xml=${ProjectDir}/LinkDescription.xml
+
+
+ true
+ full
+ false
+ bin\iPhone\Debug
+ DEBUG
+ prompt
+ 4
+ false
+ ARMv7, ARM64
+ Entitlements.plist
+ iPhone Developer
+ true
+ SdkOnly
+ --xml=${ProjectDir}/LinkDescription.xml
+
+
+ none
+ true
+ bin\iPhone\Release
+ prompt
+ 4
+ Entitlements.plist
+ ARMv7, ARM64
+ false
+ iPhone Developer
+ SdkOnly
+ --xml=${ProjectDir}/LinkDescription.xml
+
+
+ none
+ True
+ bin\iPhone\Ad-Hoc
+ prompt
+ 4
+ False
+ ARMv7, ARM64
+ Entitlements.plist
+ True
+ Automatic:AdHoc
+ iPhone Distribution
+ SdkOnly
+ --xml=${ProjectDir}/LinkDescription.xml
+
+
+ none
+ True
+ bin\iPhone\AppStore
+ prompt
+ 4
+ False
+ ARMv7, ARM64
+ Entitlements.plist
+ Automatic:AppStore
+ iPhone Distribution
+ SdkOnly
+ --xml=${ProjectDir}/LinkDescription.xml
+
+
+
+
+
+
+
+
+
+
+
+ ViewController.cs
+
+
+
+
+
+
+
+
+ ..\packages\Microsoft.Data.Sqlite.1.1.1\lib\netstandard1.3\Microsoft.Data.Sqlite.dll
+
+
+ ..\packages\Microsoft.EntityFrameworkCore.1.1.2\lib\netstandard1.3\Microsoft.EntityFrameworkCore.dll
+
+
+ ..\packages\Microsoft.EntityFrameworkCore.Relational.1.1.2\lib\netstandard1.3\Microsoft.EntityFrameworkCore.Relational.dll
+
+
+ ..\packages\Microsoft.EntityFrameworkCore.Sqlite.1.1.2\lib\netstandard1.3\Microsoft.EntityFrameworkCore.Sqlite.dll
+
+
+ ..\packages\Microsoft.Extensions.Caching.Abstractions.1.1.2\lib\netstandard1.0\Microsoft.Extensions.Caching.Abstractions.dll
+
+
+ ..\packages\Microsoft.Extensions.Caching.Memory.1.1.2\lib\netstandard1.3\Microsoft.Extensions.Caching.Memory.dll
+
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.1.1.1\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll
+
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.1.1\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
+
+
+ ..\packages\Microsoft.Extensions.Logging.1.1.2\lib\netstandard1.1\Microsoft.Extensions.Logging.dll
+
+
+ ..\packages\Microsoft.Extensions.Logging.Abstractions.1.1.2\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll
+
+
+ ..\packages\Microsoft.Extensions.Options.1.1.2\lib\netstandard1.0\Microsoft.Extensions.Options.dll
+
+
+ ..\packages\Microsoft.Extensions.Primitives.1.1.1\lib\netstandard1.0\Microsoft.Extensions.Primitives.dll
+
+
+ ..\packages\Remotion.Linq.2.1.1\lib\portable-net45+win+wpa81+wp80\Remotion.Linq.dll
+
+
+
+ ..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll
+
+
+ ..\packages\System.Diagnostics.DiagnosticSource.4.3.1\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll
+
+
+ ..\packages\System.Interactive.Async.3.1.1\lib\netstandard1.3\System.Interactive.Async.dll
+
+
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.3.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll
+
+
+
+
+
+
+
+
+
+
+
+ {921546d5-afbe-4c9f-a544-ab12eb3a04d6}
+ EntityFrameworkWithXamarin.Core
+
+
+
+
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/Info.plist b/EntityFrameworkWithXamarin.iOS/Info.plist
new file mode 100644
index 0000000..70bba9c
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/Info.plist
@@ -0,0 +1,45 @@
+
+
+
+
+ CFBundleDisplayName
+ EntityFrameworkWithXamarin.iOS
+ CFBundleIdentifier
+ com.companyname.EntityFrameworkWithXamarin.iOS
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1.0
+ LSRequiresIPhoneOS
+
+ MinimumOSVersion
+
+ UIDeviceFamily
+
+ 1
+ 2
+
+ UILaunchStoryboardName
+ LaunchScreen
+ UIMainStoryboardFile
+ Main
+ UIMainStoryboardFile~ipad
+ Main
+ UIRequiredDeviceCapabilities
+
+ armv7
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+
+
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/LinkDescription.xml b/EntityFrameworkWithXamarin.iOS/LinkDescription.xml
new file mode 100644
index 0000000..0c1654b
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/LinkDescription.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EntityFrameworkWithXamarin.iOS/Main.cs b/EntityFrameworkWithXamarin.iOS/Main.cs
new file mode 100644
index 0000000..8e8e855
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/Main.cs
@@ -0,0 +1,15 @@
+using UIKit;
+
+namespace EntityFrameworkWithXamarin.iOS
+{
+ public class Application
+ {
+ // This is the main entry point of the application.
+ static void Main(string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main(args, null, "AppDelegate");
+ }
+ }
+}
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/Main.storyboard b/EntityFrameworkWithXamarin.iOS/Main.storyboard
new file mode 100644
index 0000000..3a9ea83
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/Main.storyboard
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/Properties/AssemblyInfo.cs b/EntityFrameworkWithXamarin.iOS/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..fb19e8a
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EntityFrameworkWithXamarin.iOS")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("EntityFrameworkWithXamarin.iOS")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("0e143b83-07b7-4d5d-ae9b-1ceb89f23f6f")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/EntityFrameworkWithXamarin.iOS/Resources/LaunchScreen.xib b/EntityFrameworkWithXamarin.iOS/Resources/LaunchScreen.xib
new file mode 100644
index 0000000..d0a161d
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/Resources/LaunchScreen.xib
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EntityFrameworkWithXamarin.iOS/ViewController.cs b/EntityFrameworkWithXamarin.iOS/ViewController.cs
new file mode 100644
index 0000000..222df08
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/ViewController.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using EntityFrameworkWithXamarin.Core;
+using Microsoft.EntityFrameworkCore;
+using UIKit;
+
+namespace EntityFrameworkWithXamarin.iOS
+{
+ public partial class ViewController : UIViewController
+ {
+ public ViewController(IntPtr handle) : base(handle)
+ {
+ }
+
+ public override async void ViewDidLoad()
+ {
+ System.Diagnostics.Debug.WriteLine("ViewController.ViewDidLoad()");
+ base.ViewDidLoad();
+
+ // NOTE: See LinkDescription.xml, which describes how to get the Xamarin linker to preserve key types and
+ // methods that Entity Framework Core uses only via reflection. Without such instructions to the linker,
+ // EF Core code such as below would generate runtime errors when the linker is used; e.g. in builds that
+ // are deployed to device or for publishing to the App Store. Unfortunately, such issues aren't immediately
+ // evident when running a sample like this in the simulator, as the default Xamarin iOS project config has
+ // linking disabled for the iPhoneSimulator target.
+
+ var dbFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
+ var fileName = "Cats.db";
+ var dbFullPath = Path.Combine(dbFolder, fileName);
+ try
+ {
+ using (var db = new CatContext(dbFullPath))
+ {
+ await db.Database.MigrateAsync(); //We need to ensure the latest Migration was added. This is different than EnsureDatabaseCreated.
+
+ Cat catGary = new Cat() { CatId = 1, Name = "Gary", MeowsPerSecond = 5 };
+ Cat catJack = new Cat() { CatId = 2, Name = "Jack", MeowsPerSecond = 11 };
+ Cat catLuna = new Cat() { CatId = 3, Name = "Luna", MeowsPerSecond = 3 };
+
+ List catsInTheHat = new List() { catGary, catJack, catLuna };
+
+ if (await db.Cats.CountAsync() < 3)
+ {
+ await db.Cats.AddRangeAsync(catsInTheHat);
+ await db.SaveChangesAsync();
+ }
+
+ var catsInTheBag = await db.Cats.ToListAsync();
+
+ foreach (var cat in catsInTheBag)
+ {
+ textView.Text += $"{cat.CatId} - {cat.Name} - {cat.MeowsPerSecond}" + System.Environment.NewLine;
+ }
+ }
+
+ }
+ catch (Exception ex)
+ {
+ System.Diagnostics.Debug.WriteLine(ex.ToString());
+ }
+ }
+
+ partial void Button_TouchUpInside(UIButton sender)
+ {
+ // The button logic isn't related to EF Core but is here to mimic the Droid sample project.
+ button.SetTitle(string.Format("{0} clicks!", _count++), UIControlState.Normal);
+ }
+
+ private static int _count = 1;
+ }
+}
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/ViewController.designer.cs b/EntityFrameworkWithXamarin.iOS/ViewController.designer.cs
new file mode 100644
index 0000000..39a7e51
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/ViewController.designer.cs
@@ -0,0 +1,41 @@
+// WARNING
+//
+// This file has been generated automatically by Visual Studio from the outlets and
+// actions declared in your storyboard file.
+// Manual changes to this file will not be maintained.
+//
+using Foundation;
+using System;
+using System.CodeDom.Compiler;
+
+namespace EntityFrameworkWithXamarin.iOS
+{
+ [Register ("ViewController")]
+ partial class ViewController
+ {
+ [Outlet]
+ [GeneratedCode ("iOS Designer", "1.0")]
+ UIKit.UIButton button { get; set; }
+
+ [Outlet]
+ [GeneratedCode ("iOS Designer", "1.0")]
+ UIKit.UITextView textView { get; set; }
+
+ [Action ("Button_TouchUpInside:")]
+ [GeneratedCode ("iOS Designer", "1.0")]
+ partial void Button_TouchUpInside (UIKit.UIButton sender);
+
+ void ReleaseDesignerOutlets ()
+ {
+ if (button != null) {
+ button.Dispose ();
+ button = null;
+ }
+
+ if (textView != null) {
+ textView.Dispose ();
+ textView = null;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/app.config b/EntityFrameworkWithXamarin.iOS/app.config
new file mode 100644
index 0000000..a3e4efa
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/app.config
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.iOS/packages.config b/EntityFrameworkWithXamarin.iOS/packages.config
new file mode 100644
index 0000000..45de0aa
--- /dev/null
+++ b/EntityFrameworkWithXamarin.iOS/packages.config
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EntityFrameworkWithXamarin.sln b/EntityFrameworkWithXamarin.sln
index 4987e7f..0dc05aa 100644
--- a/EntityFrameworkWithXamarin.sln
+++ b/EntityFrameworkWithXamarin.sln
@@ -1,34 +1,136 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkWithXamarin.Core", "EntityFrameworkWithXamarin.Core\EntityFrameworkWithXamarin.Core.csproj", "{921546D5-AFBE-4C9F-A544-AB12EB3A04D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkWithXamarin.Droid", "EntityFrameworkWithXamarin.Droid\EntityFrameworkWithXamarin.Droid.csproj", "{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}"
EndProject
-Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "EntityFrameworkWithXamarin.MigrationsBait", "EntityFrameworkWithXamarin.MigrationsBait\EntityFrameworkWithXamarin.MigrationsBait.xproj", "{A970CE65-69E6-4CC0-A34E-ED87DA7EF515}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityFrameworkWithXamarin.MigrationsBait", "EntityFrameworkWithXamarin.MigrationsBait\EntityFrameworkWithXamarin.MigrationsBait.csproj", "{A970CE65-69E6-4CC0-A34E-ED87DA7EF515}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameworkWithXamarin.iOS", "EntityFrameworkWithXamarin.iOS\EntityFrameworkWithXamarin.iOS.csproj", "{0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
+ Ad-Hoc|iPhone = Ad-Hoc|iPhone
+ Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
+ AppStore|Any CPU = AppStore|Any CPU
+ AppStore|iPhone = AppStore|iPhone
+ AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
Debug|Any CPU = Debug|Any CPU
+ Debug|iPhone = Debug|iPhone
+ Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|Any CPU = Release|Any CPU
+ Release|iPhone = Release|iPhone
+ Release|iPhoneSimulator = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.AppStore|Any CPU.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.AppStore|iPhone.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.AppStore|iPhone.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Release|iPhone.Build.0 = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {921546D5-AFBE-4C9F-A544-AB12EB3A04D6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|Any CPU.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|Any CPU.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|iPhone.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|iPhone.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|iPhone.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU
{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|iPhone.Deploy.0 = Debug|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|Any CPU.Build.0 = Release|Any CPU
{CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|iPhone.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|iPhone.Deploy.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {CF7D47CD-A44F-4308-8D8C-C3901CF0C31F}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.AppStore|Any CPU.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.AppStore|iPhone.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.AppStore|iPhone.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Release|iPhone.Build.0 = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {A970CE65-69E6-4CC0-A34E-ED87DA7EF515}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.AppStore|iPhone.Build.0 = AppStore|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Debug|Any CPU.ActiveCfg = Debug|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Debug|iPhone.ActiveCfg = Debug|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Debug|iPhone.Build.0 = Debug|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Release|Any CPU.ActiveCfg = Release|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Release|iPhone.ActiveCfg = Release|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Release|iPhone.Build.0 = Release|iPhone
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
+ {0E143B83-07B7-4D5D-AE9B-1CEB89F23F6F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE