Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Relates to the sample for your blog post at https://blog.xamarin.com/building-android-apps-with-entity-framework. Thanks for that!)
Now that Xamarin.iOS 10.10 addressed the
NotImplementedException
blocker bug (dotnet/efcore#7158), I updated your sample to include a new iOS project that runs the same EF Core code example from the Droid project.Getting the iOS app to run the same EF Core code successfully in the iOS simulator was straightforward with the new bits. However, getting the iOS app to run that EF Core code on an a physical iOS device took a bit more work:
Xamarin's default build configurations targeting the iOS simulator do not perform the linking that is typical of a device build. When targeting a device, the Xamarin linker removes unreferenced SDK types and methods from generated code. However, EF Core's query parser refers to certain SDK types and methods only via reflection. (e.g. search the EF Core repo for instances of
GetRuntimeMethod
.)The linker directives in the iOS project's
LinkDescription.xml
file ensure the iOS app can run successfully on a physical iOS device. (I included a reference to this file via project settings "Additional mtouch arguments", as Visual Studio 2017 on PC is lacking theLinkDescription
"Build Action" that is available on Visual Studio for Mac / Xamarin Studio.)