Skip to content

Add an EF Core context adapter - #156

Merged
vb2ae merged 2 commits into
masterfrom
copilot/create-entity-framework-provider
Nov 25, 2026
Merged

vb2ae merged 2 commits into
masterfrom
copilot/create-entity-framework-provider

Conversation

@vb2ae

@vb2ae vb2ae commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

ClientNoSqlDB lacked an Entity Framework integration. This adds an EF Core 10 adapter for querying and persisting tracked entities through DbContext.

  • Adapter: Adds ClientNoSqlDB.EntityFrameworkCore with model key mapping, snapshot loading on Initialize, and persistence of added, modified, and deleted entities via SaveChanges.
  • Usage: Derive a context, expose DbSet properties, then initialize it before querying or saving:
    public class PeopleContext(string path) : ClientNoSqlDbContext(path)
    {
        public DbSet<Person> People => Set<Person>();
    }
    
    using var db = new PeopleContext("people");
    db.Initialize();
    db.People.Add(new Person { Id = 1, FirstName = "Ada" });
    db.SaveChanges();
    var people = db.People.Where(person => person.FirstName == "Ada").ToList();
  • Scope: LINQ queries run in memory over the loaded snapshot. Models require a single key and supported public scalar members; owned and inherited entity types are not supported.

Copilot AI linked an issue Nov 23, 2026 that may be closed by this pull request
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@vb2ae vb2ae changed the title [WIP] Add entity framework provider for client NoSQL database Add an EF Core context adapter Nov 23, 2026
@vb2ae vb2ae linked an issue Nov 24, 2026 that may be closed by this pull request
@vb2ae
vb2ae marked this pull request as ready for review November 25, 2026 11:02
@vb2ae
vb2ae merged commit 8454608 into master Nov 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add official entity framework unit tests Create an Entity framework provider

2 participants