Closed martsve closed 1 month ago
I'm unable to reproduce the behavior you're describing. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
I'm closing because of inactivity. Will open when required information is provided.
I see this too using 8.0.8, when the GroupBy is terminal.. no matter if executing against SQLite or NPGSQL (PostgreSQL)
Minimal repro (with 9.0.0-rc.1) below. This is probably an oversight in the final GroupBy shaper (which is a special shaper).
await using var context = new BlogContext();
await context.Database.EnsureDeletedAsync();
await context.Database.EnsureCreatedAsync();
// Tags not emitted
_ = await context.Blogs.TagWith("foo").GroupBy(b => b.Name).ToListAsync();
// Tags are emitted
_ = await context.Blogs.TagWith("foo").ToListAsync();
public class BlogContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder
.UseSqlServer("Server=localhost;Database=test;User=SA;Password=Abcd5678;Connect Timeout=60;ConnectRetryCount=0;Encrypt=false")
.LogTo(Console.WriteLine, LogLevel.Information)
.EnableSensitiveDataLogging();
}
public class Blog
{
public int Id { get; set; }
public string Name { get; set; }
}
When performing a GroupBy any tags you have previously added to the IQueryable will disappear.
EF Core version: