📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

1325 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.

EF Core Fundamentals

DbContext, DbSet, entities, model configuration, migrations, relationships, keys and foreign keys, shadow properties, value converters, owned entities, complex types and backing fields in EF Core 10.

  1. What are shadow properties and backing fields in EF Core? When would you use each, and how do you map an aggregate that exposes a read-only collection while EF Core still loads and saves it?

    Covers EF Core shadow properties (EF.Property, audit and FK uses), backing fields and property access modes, and mapping encapsulated read-only collections in DDD aggregates.

    Mid-Level Theory EF Core Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  2. Show how you use value converters in EF Core: store an enum as a string, map strongly typed IDs such as OrderId, and handle a Money value object. When do you need a value comparer, and which LINQ queries break on converted properties?

    Covers EF Core value converters (HasConversion, built-in and custom ValueConverter), enums as strings, strongly typed IDs with record structs and ConfigureConventions, value comparers for mutable types, why Money fits a complex type better, and query translation pitfalls.

    Mid-Level Coding EF Core Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  3. Owned entities or complex types: how do you map value objects such as Address or Money in EF Core 10? Explain table splitting, separate tables and JSON columns, how each behaves in change tracking, and which you would choose today.

    Covers mapping value objects in EF Core 10: owned entity types (OwnsOne, OwnsMany, hidden keys, reference semantics), complex types (ComplexProperty, value semantics, optional and collection support, JSON mapping in EF Core 10), table splitting and ToJson, and the current recommendation.

    Mid-Level Theory EF Core Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  4. You renamed a property, but the generated EF Core migration drops the column and adds a new one. On another branch, Database.Migrate() now fails with a 'pending model changes' error on EF Core 9 or later. How do you review and fix both problems?

    Covers debugging EF Core migrations: why the differ scaffolds drop and add instead of a rename, the data-loss warning, editing a migration to RenameColumn, and the EF Core 9+ PendingModelChangesWarning including non-deterministic seed data.

    Mid-Level Debugging EF Core Fundamentals Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  5. Code review: a new service's DbContext sets the connection string in OnConfiguring, turns on lazy loading proxies, leaves every string unconfigured, keeps cascade delete on every relationship and uses Guid.NewGuid() clustered primary keys. What do you flag, in what order, and what does the fixed configuration look like?

    A senior code review of an EF Core model configuration covering a hard-coded connection string in OnConfiguring, lazy loading proxies, nvarchar(max) strings, cascade delete everywhere and random GUID clustered keys, ranked by severity with a rewrite.

    Senior CodeReview EF Core Fundamentals Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me