I have implemented the Ef Core Sqlite In Xamarin forms.The Target Plateform is .netstandrd 2.0 how to use migration

605 Views Asked by At

i have implemented The Ef core Sqlite in Xamarin forms the project plateform is .netstanderd 2.0 Now i want to use Migration in my Project but migration required .netcore plate form but i have .net standerd. any salution for this problem. are i target multiple plateform? i have try to edite .csproj and

 <PropertyGroup>
    <TargetFrameworks>netstandard2.0;netcore2.0</TargetFrameworks>
  </PropertyGroup>

But this is not working help me to solve it

1

There are 1 best solutions below

0
mvermef On

Create a separate Console application within your solution.

Run your commands for the migrations to be generated within the console application.

Then transfer source code generated to your XF app, wire up the DbContext code that you generated for the migrations..

Rinse repeat for each change to the database. No it isn't ideal.

https://forums.xamarin.com/discussion/101805/xamarin-android-entity-framework-core-2-and-migrations