Greetings, I recommend that you use .NET Standard since it will generate a library compatible with the majority of .NET implementations (.NET Framework, dotnet core and xamarin).
Here they explain more details:
link
Regarding the generation of your dbcontext using scaffold
If you use Visual Studio you can follow these instructions to do so with NuGet Package Manager Console
1.Install-Package Microsoft.EntityFrameworkCore.SqlServer
2.Install-Package Microsoft.EntityFrameworkCore.Tools
Then you use this command to generate your database
Scaffold-DbContext "Server=Sqlsever;Database=dbname;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Microsoft Documentation here
If you use Visual Studio Code it would be using dotnet CLI
Your project should look like this
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
</ItemGroup>
</Project>
To install these packages you must use dotnet add package.
After having the project in this way without any error you use this command:
dotnet ef dbcontext scaffold "Server=Server;Database=Dbname;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer --startup-project ..\ProyectoNETCore -o Models
Remember that it is important to specify the project to start , which must be a .net core project from another you should add the .net core framework to the .netstandard project, because in order for this to work it must if there is a project using .net core somewhere
Official documentation here
Related link