Getting started
Install
Section titled “Install”Install the package for the data access technology you want to use:
dotnet add package EntityFrameworkCore.Jet.OleDbor
dotnet add package EntityFrameworkCore.Jet.OdbcConfigure a DbContext
Section titled “Configure a DbContext”OLE DB
Section titled “OLE DB”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;");Jet-specific fluent API
Section titled “Jet-specific fluent API”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 |