Round #853
11 May 2026, 09:47· csharp· Meta-Llama-3.3-70B-Instruct· r15-firing-v3
- Complexity
- band 1
- ZP / UO / OBS
- 3 / 6 / 2
- Journey weight
- 675
- Lightshift ΔL
- +0.17
Prompt
Define a DbContext with two entities (Order and Customer) related one-to-many. Show the OnModelCreating configuration and a simple query that loads orders with their customer.
Zero-point index (what the engine surfaced)
ZPI-ZPI-0010 | 2026-05-11T09:47:22Z
Define a DbContext with two entities (Order and Customer) related one-to-many. Show the OnModelCreating configuration and a simple query that loads orders with their customer.
ZERO POINT — 3 entries (structural invariants)
● hsl(136.10, 100%, 50%) DbContext [contract]
● hsl(282.77, 100%, 35%) DbSet<T> [contract]
● hsl(29.31, 100%, 35%) IEntityTypeConfiguration<T> [contract]
UNOBSERVED — 6 entries (implied truths)
○ hsl(348.72, 100%, 36%) IDisposable [feature]
○ hsl(27.69, 100%, 50%) async [feature]
○ hsl(9.23, 100%, 50%) interface [feature]
○ hsl(83.08, 100%, 42%) ILogger of T injection [function]
○ hsl(180.92, 100%, 28%) Database health check [function]
○ hsl(144.00, 100%, 42%) Connection resilience [function]
OBSERVED — 2 entries (explicit in request)
◉ hsl(98.46, 100%, 50%) with [feature]
◉ hsl(129.23, 100%, 7%) DbContext configuration [function]
COMPLEXITY │ 11 entries │ spread: 339° │ band: MEDIUM
Baseline response (no ZPI)
```csharp
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
// Define the Customer entity
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Order> Orders { get; set; }
}
// Define the Order entity
public class Order
{
public int Id { get; set; }
public int CustomerId { get; set; }
public Customer Customer { get; set; }
public DateTime OrderDate { get; set; }
}
// Define the DbContext
public class MyDbContext : DbContext
{
public DbSet<Customer> Customers { get; set; }
public DbSet<Order> Orders { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseInMemoryDatabase(databaseName: "MyDbContext");
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Order>()
.HasOne(o => o.Customer)
.WithMany(c => c.Orders)
.HasForeignKey(o => o.CustomerId);
}
}
class Program
{
static void Main()
{
// Create a new instance of the DbContext
using var context = new MyDbContext();
// Add some sample data
var customer1 = new Customer { Name = "John Doe" };
var customer2 = new Customer { Name = "Jane Doe" };
var order1 = new Order { CustomerId = 1, OrderDate = DateTime.Now };
var order2 = new Order { CustomerId = 1, OrderDate = DateTime.Now };
var order3 = new Order { CustomerId = 2, OrderDate = DateTime.Now };
context.Customers.Add(customer1);
context.Customers.Add(customer2);
context.Orders.Add(order1);
context.Orders.Add(order2);
context.Orders.Add(order3);
context.SaveChanges();
// Query orders with their customer
var ordersWithCustomer = context.Orders
.Include(o => o.Customer)
.ToList();
foreach (var order in ordersWithCustomer)
{
Console.WriteLine($"Order {order.Id} - Customer: {order.Customer.Name} - Order Date: {order.OrderDate}");
}
}
}
```
In this example, we define two entities: `Customer` and `Order`. A customer can have multiple orders, and an order is associated with one customer. The `OnModelCreating` method is used to configure the one-to-many relationship between `Customer` and `Order`.
The `Main` method demonstrates how to create a new instance of the `MyDbContext`, add some sample data, and query orders with their associated customer using the `Include` method to eager load the related data.
Enhanced response (with ZPI)
```csharp
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
public class OrderContext : DbContext
{
private readonly ILogger<OrderContext> _logger;
public OrderContext(DbContextOptions<OrderContext> options, ILogger<OrderContext> logger)
: base(options)
{
_logger = logger;
}
public DbSet<Order> Orders { get; set; }
public DbSet<Customer> Customers { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Order>()
.HasOne(o => o.Customer)
.WithMany(c => c.Orders)
.HasForeignKey(o => o.CustomerId);
}
}
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Order> Orders { get; set; }
}
public class Order
{
public int Id { get; set; }
public int CustomerId { get; set; }
public Customer Customer { get; set; }
public string Description { get; set; }
}
public class OrderContextConfiguration : IEntityTypeConfiguration<OrderContext>
{
public void Configure(EntityTypeBuilder<OrderContext> builder)
{
// Additional configuration if needed
}
}
class Program
{
static async Task Main(string[] args)
{
var options = new DbContextOptionsBuilder<OrderContext>()
.UseInMemoryDatabase(databaseName: "OrderDatabase")
.Options;
var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
var logger = loggerFactory.CreateLogger<OrderContext>();
using var context = new OrderContext(options, logger);
context.Database.EnsureCreated();
// Add some sample data
var customer = new Customer { Name = "John Doe" };
context.Customers.Add(customer);
context.SaveChanges();
var order = new Order { CustomerId = customer.Id, Description = "Sample Order" };
context.Orders.Add(order);
context.SaveChanges();
// Query orders with their customer
var ordersWithCustomer = await context.Orders
.Include(o => o.Customer)
.ToListAsync();
foreach (var orderWithCustomer in ordersWithCustomer)
{
Console.WriteLine($"Order {orderWithCustomer.Id} - Customer: {orderWithCustomer.Customer.Name}");
}
}
}
```
This implementation defines a `DbContext` named `OrderContext` with two entities: `Order` and `Customer`. The `OnModelCreating` method configures the one-to-many relationship between `Order` and `Customer`. The `Main` method demonstrates how to use the context to query orders with their associated customer. The `ILogger` of `T` injection is used to log any potential issues. Connection resilience and database health check are not explicitly implemented in this example but can be added as needed.
Grader chain
Each grader reads the same baseline + enhanced pair and casts an independent verdict. Disagreement is the framework's own signal — not noise to be averaged away.
V1samba/Meta-Llama-3.3-70B-Instruct
BetterV4qwen2.5-coder-3b-instruct
BetterV5openrouter/qwen/qwen3-235b-a22b-2507
BetterV7qwen2.5-coder-7b-instruct
BetterV8openai/gpt-4.1
WorseV9anthropic/claude-opus-4-7
WorseV12openai/gpt-4o
BetterComments
Our grader said what it said. What do you say? Comment as a guest below.
No comments yet. Be the first to say what you make of this round.