Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Binary incompatibility between SDK compiled against EF Core 9.0.0 and user applications using EF Core 9.0.10+ causes MissingMethodException when using Include() with one-to-many relations:

var blog = db.Blogs.Include(_ => _.Posts).First();
// throws: Method not found: 'Microsoft.EntityFrameworkCore.Storage.IRelationalCommandBuilder.Append(System.String)'

Issue Number: N/A

What is the new behavior?

SDK now targets EF Core 9.0.10, resolving binary compatibility issues. Include() operations on one-to-many relations work correctly.

Updated dependencies:

  • Microsoft.EntityFrameworkCore: 9.0.0 → 9.0.10
  • Microsoft.EntityFrameworkCore.Relational: 9.0.0 → 9.0.10
  • Microsoft.EntityFrameworkCore.Relational.Specification.Tests: 9.0.1 → 9.0.10

Other information

All ModelBuilding tests (124 tests including one-to-many scenarios) pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>bug: One-to-Many issue</issue_title>
<issue_description># Bug Report

YDB dotnet SDK version:

0.2.0

Issue

With using one-to-many relations and try to load whole object with "Include" method - drop exception:

System.MissingMethodException: 'Method not found: 'Microsoft.EntityFrameworkCore.Storage.IRelationalCommandBuilder Microsoft.EntityFrameworkCore.Storage.IRelationalCommandBuilder.Append(System.String)'.'

Tests with PostgreSQL library and EF Core 10 with the same test classes - working fine

Example code

Two relations classes:

public class YdbBlog
{
    public int Id { get; set; }
    public string Name { get; set; }
    public virtual ICollection<YdbPost> Posts { get; set; } = new List<YdbPost>();
}

public class YdbPost
{
    public int Id { get; set; }
    public string Title { get; set; }
    public string Content { get; set; }
    public virtual YdbBlog Blog { get; set; }
    public int BlogId { get; set; }
}

YdbContext:

public class YdbDbContext : DbContext
{
    public DbSet<YdbBlog> Blogs { get; set; }

    public YdbDbContext()
    {
        Database.EnsureCreated();
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<YdbPost>()
                .HasOne(m => m.Blog)
                .WithMany(t => t.Posts)
                .HasForeignKey(m => m.Id);

        modelBuilder.Entity<YdbBlog>().HasMany(t => t.Posts).WithOne(_ => _.Blog).HasForeignKey(_ => _.BlogId);

    }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        optionsBuilder.UseYdb("UseTls=false;Host=localhost;Port=2136;Database=/local");
    }
}

How to reproduce the error

code for inserting data:

using (var db = new YdbDbContext())
{
    var blog = new YdbBlog()
    {
        Id = 1,
        Name = "test blog"
    };
   blog.Posts.Add(new YdbPost { Id = 1, Title = "subject", Content = "message" });
    db.Blogs.Add(blog);
    db.SaveChanges();
}

code for reproduce:

using (var db = new YdbDbContext())
{
    var blog = db.Blogs.Include(_ => _.Posts).First();
}

How to resolve
Return to 9.0.10 EF Core</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix one-to-many relation loading exception Update EF Core dependencies to 9.0.10 to fix Include() runtime errors Nov 23, 2025
Copilot AI requested a review from asmyasnikov November 23, 2025 13:47
Copilot finished work on behalf of asmyasnikov November 23, 2025 13:47
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.

bug: One-to-Many issue

2 participants