How to use Dotnet ef tool to create access tables class

Andrew Hsiao 1 Reputation point
2021-08-06T01:09:05.657+00:00

Now,I had use the assemables with EntityframworkCore.Jet and EntityframeworkCore.Jet.Oledb are not be create the access tables classes by entityframeworkCore
use DotNet ef tool
the command is
dotnet ef dbcontext scaffold "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=123.accdb,OleDbFactory.Instance" DotNetFramworkCore.Jet --project windowsformsapp1

dotnet ef dbcontext scaffold "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=123.accdb,OleDbFactory.Instance" EntityframeworkCore.Jet.Oledb --project windowsformsapp1

dotnet ef dbcontext scaffold "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=123.accdb,OleDbFactory.Instance" System.Data.OleDB --project windowsformsapp1

do I build the entityframworkCore command ?

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
726 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,386 Reputation points
    2021-08-08T23:51:18.84+00:00

    You can try my tool to scaffold your Access database which I wrote a while back for fun.

    From the screenshot below it generated

    Scaffold-DbContext "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\OED\Dotnetland\ScaffoldDbContextHelper\AccessScaffoldDbContextHelper\bin\Debug\NorthWind.accdb" -Provider EntityFrameworkCore.Jet -OutputDir Models  -Context NorthContext  -v -f  -project Microsoft.Access.Data -startupproject Microsoft.Access.Data -ContextDir Contexts -t "Categories","Customers","CustomersContactTitle","Employees","Orders","Products","Suppliers","SuppliersContactTitle"  
    

    121501-accessreverse.png

    121493-figure1.png

    1 person found this answer helpful.
    0 comments No comments