What is a delegate and how do events use it?
Simple meaning
A delegate is a type-safe function pointer.
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.
A delegate is a type-safe function pointer.
Open the full page for Why, Steps, Example and Key takeaway.
Generics keep type safety and avoid boxing of value types.
Open the full page for Why, Steps, Example and Key takeaway.
Transient is a new instance every resolve.
Open the full page for Why, Steps, Example and Key takeaway.
The context snapshots entity instances and generates INSERT, UPDATE, or DELETE on SaveChanges.
Open the full page for Why, Steps, Example and Key takeaway.
I Include the navigation I need, or project to an anonymous type or DTO in one Select.
Open the full page for Why, Steps, Example and Key takeaway.
Ref passes a variable that must already be assigned and can be read and written.
Open the full page for Why, Steps, Example and Key takeaway.
Records are reference types with value-based equality and a concise init syntax.
Open the full page for Why, Steps, Example and Key takeaway.
Exceptions are for unexpected failures
Open the full page for Why, Steps, Example and Key takeaway.
The pool reuses worker threads for Tasks and I/O completions.
Open the full page for Why, Steps, Example and Key takeaway.
The GC frees unreachable objects, but event handlers, static caches, and forgotten subscriptions keep objects reachable.
Open the full page for Why, Steps, Example and Key takeaway.
Async await frees threads while waiting on I/O without blocking.
Open the full page for Why, Steps, Example and Key takeaway.
The Common Language Runtime runs .NET bytecode, handles memory with GC, and provides security and type safety.
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.
Middleware forms a pipeline that handles each HTTP request: logging, auth, routing, endpoints.
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.
Thread-safe dictionary operations without a coarse lock for every access.
Open the full page for Why, Steps, Example and Key takeaway.