Skip to content

Getting started

Install the package for the data access technology you want to use:

Terminal window
dotnet add package EntityFrameworkCore.Jet.OleDb

or

Terminal window
dotnet add package EntityFrameworkCore.Jet.Odbc
using Microsoft.EntityFrameworkCore;
public class BloggingContext : DbContext
{
public DbSet<Blog> Blogs => Set<Blog>();
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseJetOleDb(
@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Data\Blogging.accdb");
}
public class Blog
{
public int Id { get; set; }
public string? Url { get; set; }
}
optionsBuilder.UseJetOdbc(
@"Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\Data\Blogging.accdb;");

Some fluent API names are Jet-specific, which makes it simpler to configure one model for more than one provider:

General name Jet name
UseIdentityColumn UseJetIdentityColumn
UseIdentityColumns UseJetIdentityColumns