DEV Community

Yass- Cloud and AI Explorer
Yass- Cloud and AI Explorer

Posted on

Can You Pass This .NET 11 Challenge? 3 Tricky EF Core 11 & ASP.NET Core 11 Scenarios (20-Question Quiz)

Following the great discussions on our recent guide covering What's New in EF Core 11 and ASP.NET Core 11, it's clear that while .NET 11 brings fantastic performance gains, its subtle breaking changes will catch many teams off guard in production.

To help developers audit their code before the November 2026 GA release, I created a full 20-Question Interactive Practice Test & Cheat Sheet on Iwalen.

Here are 3 tricky real-world scenarios from the test. Can you spot the bug or the right architectural fix? Drop your answers in the comments before checking the key! 👇


Challenge 1: The Disappearing Vectors in SQL Server 2025

Your RAG service re-ranks search results in C# after a database lookup. Right after upgrading to EF Core 11, the re-ranker throws an exception because doc.Embedding is null:

public class Document
{
    public int Id { get; set; }
    public required string Title { get; set; }

    [Column(TypeName = "vector(1536)")]
    public SqlVector<float> Embedding { get; set; }
}

var doc = await db.Documents.FirstAsync(d => d.Id == id);
var score = Reranker.Score(doc.Embedding, queryVector); // doc.Embedding is NULL in EF Core 11!
Enter fullscreen mode Exit fullscreen mode

What is the fix?

  • A) Call .Include(d => d.Embedding) to include the vector column.
  • B) EF Core 11 omits SqlVector<T> columns from default entity SELECT statements; project the column explicitly via .Select(d => new { d.Id, d.Embedding }).
  • C) Change the property type to SqlVector<float>? because EF Core 11 only skips non-nullable vectors.
  • D) Await a lazy-loading proxy call because vectors are now lazy-loaded on property access.

Challenge 2: The Staging Authentication Crash

After upgrading an order service to EF Core 11, all integration tests pass locally against a Docker container with password auth. But in Azure staging, startup crashes immediately with this connection string:

Server=tcp:contoso-sql.database.windows.net;Database=Orders;Authentication=Active Directory Managed Identity;
Enter fullscreen mode Exit fullscreen mode

No C# code changed during the upgrade. What is missing?

  • A) Managed Identity was removed from SqlClient 7.0; you must migrate to SQL authentication.
  • B) You must set UseCompatibilityLevel(150) in UseSqlServer(...) because level 160 breaks Entra ID tokens.
  • C) You must install Microsoft.Data.SqlClient.Extensions.Azure, because SqlClient 7.0 unbundled Entra ID dependencies from the core package.
  • D) Switch to Authentication=Active Directory Password, which remains in core SqlClient 7.0.

Challenge 3: The Cross-Assembly Validation Trap

You split your solution into a host project (Contoso.Api.dll) and a class library containing your Minimal API route groups (Contoso.Orders.Endpoints.dll):

// Host project Program.cs:
builder.Services.AddValidation();
app.MapOrderEndpoints();

// In Contoso.Orders.Endpoints.dll:
public static class OrderEndpoints
{
    public static void MapOrderEndpoints(this IEndpointRouteBuilder app) =>
        app.MapPost("/orders", (CreateOrderRequest req) => TypedResults.Ok(req));
}

public sealed class CreateOrderRequest
{
    [Required, Range(1, 100)] public int? Quantity { get; set; }
}
Enter fullscreen mode Exit fullscreen mode

When a client sends { "quantity": 500 }, the endpoint returns 200 OK instead of 400 Bad Request. Why?

  • A) The validation source generator only scans types in the assembly where AddValidation() is called; you must call services.AddValidation() inside the endpoints assembly.
  • B) DataAnnotations in class libraries require registering builder.Services.AddControllers().
  • C) You must add [assembly: ValidatableType] inside the host Program.cs.
  • D) Minimal API validation is disabled in Production by default.

Ready to Test Yourself on All 20 Scenarios?

The full test covers 17 additional scenarios including:

  • Complex types on TPT/TPC hierarchies with .ToJson() & lambda chained indexing
  • Cosmos DB unmapped JSON data loss & synchronous I/O removal
  • SQL Server compatibility level 160 (LEAST/GREATEST) and 170 (JSON_CONTAINS)
  • Stripping no-op SQL CASTs and FullJoin LINQ queries
  • OpenAPI 3.2 default, binary response schemas (FileContentResult), and anyOf responses
  • Replacing the deleted ConcurrencyLimiter middleware
  • Built-in OpenTelemetry HTTP server span tags
  • Blazor DisplayName component precedence & QuickGrid URL-based pagination/sorting
  • Static SSR header-based CSRF protection (Sec-Fetch-Site) vs token middleware

Take the complete test, get an instant score breakdown, and inspect detailed architectural explanations for every option:

👉 Take the Free 20-Question .NET 11 Practice Test on Iwalen

More from our .NET 11 & C# 15 Series:

Top comments (0)