Entity Framework Core (EF Core) is a modern, lightweight, cross-platform Object-Relational Mapper (ORM) for .NET applications. It allows developers to work with databases using .NET objects instead of writing SQL queries for every database operation.
This interview question bank covers 50 important Entity Framework Core questions, from basic concepts to advanced topics, including DbContext, LINQ, relationships, migrations, change tracking, performance optimization, and transactions.
Section 1: Basic Entity Framework Core Questions
What is Entity Framework Core?
What is the difference between Entity Framework 6 and Entity Framework Core?
What is ORM, and why do we use it?
What are the main features of Entity Framework Core?
What are the different approaches available in Entity Framework Core?
What is the difference between Code First and Database First approaches?
What is DbContext in EF Core?
What is DbSet in Entity Framework Core?
What is the purpose of OnConfiguring() in DbContext?
How do you configure a database connection in Entity Framework Core?
What is the purpose of AddDbContext()?
What is the difference between Add(), Update(), Attach(), and Remove()?
What are EF Core migrations?
What is the difference between Add-Migration and Update-Database?
What is the purpose of SaveChanges() and SaveChangesAsync()?
Section 2: Intermediate Entity Framework Core Questions
What is LINQ, and how is it used in Entity Framework Core?
What is the difference between IQueryable and IEnumerable?
What is the difference between FirstOrDefault() and SingleOrDefault()?
What is the difference between Find() and FirstOrDefault()?
What is the difference between Include() and ThenInclude()?
What are eager loading, lazy loading, and explicit loading?
What is change tracking in EF Core?
What is the difference between tracked and untracked entities?
What is AsNoTracking(), and when should you use it?
What is the purpose of EntityState?
What are navigation properties in Entity Framework Core?
How do you configure one-to-one, one-to-many, and many-to-many relationships?
What is the difference between Data Annotations and Fluent API?
What is the purpose of the OnModelCreating() method?
What are shadow properties in EF Core?
What are owned entity types?
What is the purpose of HasQueryFilter()?
What is a global query filter?
What is the difference between ExecuteUpdate() and Update()?
How do you execute raw SQL queries in Entity Framework Core?
Section 3: Advanced Entity Framework Core Questions
What is the difference between ExecuteSqlRaw() and FromSqlRaw()?
What is the N+1 query problem in Entity Framework Core?
How can you improve query performance in EF Core?
What is compiled query in Entity Framework Core?
What is the difference between SingleQuery and SplitQuery?
What is optimistic concurrency in Entity Framework Core?
What is the purpose of concurrency tokens?
How do you implement transactions in Entity Framework Core?
What is the difference between a database transaction and TransactionScope?
What is the purpose of IDbContextFactory?
What is DbContext pooling?
What is the difference between AddDbContext() and AddDbContextPool()?
What are interceptors in Entity Framework Core?
What is the difference between EF Core and Dapper?
What are the limitations and disadvantages of Entity Framework Core?
Important Note
Entity Framework Core is different from Entity Framework 6. Although both are ORMs for .NET applications, they have differences in architecture, features, APIs, and supported platforms.
This question bank focuses specifically on Entity Framework Core and its modern features. Understanding LINQ, SQL Server, database relationships, migrations, transactions, and query optimization is also important for working effectively with EF Core.
Skills Tutorials – Learn • Build • Grow Together
Continue learning with our tutorials and interview preparation series.