What is Entity Framework Core?
EF Core is an object-relational mapper that lets .NET code query and update relational databases using entity classes and LINQ. It translates supported que
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 1069–1080 of 3610 questions
EF Core is an object-relational mapper that lets .NET code query and update relational databases using entity classes and LINQ. It translates supported que
DbContext represents a session with the database and tracks changes to entities. It is designed for a short unit of work and is not thread-safe.
EF Core tracks entity states such as Added, Modified, Deleted, and Unchanged. SaveChanges generates database commands based on those states.
Eager loading fetches related data as part of the query using Include. Explicit loading fetches it on demand. Lazy loading loads navigation data when acces
N+1 occurs when one query loads a set of rows and then an additional query runs for each row to load related data. It increases latency and database load.
Migrations record incremental schema changes based on model differences. They can be reviewed and applied in controlled deployment processes.
SQL injection happens when untrusted input is concatenated into SQL syntax. Use parameterized queries or EF Core LINQ; avoid building SQL by string concate
Many LINQ queries build an iterator or expression and run only when enumerated. Operators such as ToList, ToArray, Count, or foreach trigger execution.
IEnumerable represents in-memory or streamed enumeration using delegates. IQueryable carries an expression tree that a provider may translate, for example
Asynchronous I/O lets request threads return to the pool while waiting on network, database, or file operations. It improves scalability under I/O load but
async void cannot be awaited by callers and its exceptions cannot be observed through a returned Task. It is generally reserved for event handlers.
CancellationToken communicates a cancellation request. APIs should pass it through to database, HTTP, and other operations when supported.