What is garbage collection in .NET?
Simple meaning
GC reclaims managed objects no longer referenced.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready .NET / C# questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
GC reclaims managed objects no longer referenced.
Open the full page for Why, Steps, Example and Key takeaway.
var still has a compile-time type
Open the full page for Why, Steps, Example and Key takeaway.
An interface defines a contract of members a type must implement.
Open the full page for Why, Steps, Example and Key takeaway.
It lets a method accept a variable number of arguments as an array.
Open the full page for Why, Steps, Example and Key takeaway.
The built-in container registers services with lifetimes: transient, scoped, singleton.
Open the full page for Why, Steps, Example and Key takeaway.
Enums give named integer constants for a closed set of values.
Open the full page for Why, Steps, Example and Key takeaway.
Middleware forms a pipeline that handles each HTTP request: logging, auth, routing, endpoints.
Open the full page for Why, Steps, Example and Key takeaway.
throw keeps the original stack trace when rethrowing.
Open the full page for Why, Steps, Example and Key takeaway.
EF Core is an ORM that maps C# classes to tables and generates SQL.
Open the full page for Why, Steps, Example and Key takeaway.
List grows dynamically and has helpful methods.
Open the full page for Why, Steps, Example and Key takeaway.
Any can stop at the first match.
Open the full page for Why, Steps, Example and Key takeaway.
It overrides base appsettings for the Development environment.
Open the full page for Why, Steps, Example and Key takeaway.
It redirects HTTP requests to HTTPS.
Open the full page for Why, Steps, Example and Key takeaway.
Both persist tracked changes
Open the full page for Why, Steps, Example and Key takeaway.
Constructor injection makes required dependencies obvious and testable.
Open the full page for Why, Steps, Example and Key takeaway.
They wrap the whole file in a namespace without nested braces.
Open the full page for Why, Steps, Example and Key takeaway.
It declares constructor parameters on the type itself and can capture them as fields.
Open the full page for Why, Steps, Example and Key takeaway.
required forces object initializers or constructors to set those properties.
Open the full page for Why, Steps, Example and Key takeaway.
It provides atomic increments and compare-exchange without a full lock.
Open the full page for Why, Steps, Example and Key takeaway.
Task.Run is the modern short form for offloading to the thread pool.
Open the full page for Why, Steps, Example and Key takeaway.