Browse by Topic

Popular

Latest

Latest Posts

A visual representation of a C# LINQ Where filter selecting items from a collection, with a funnel metaphor.
C#

How to Use Where in C# LINQ

Learn how the Where method filters sequences in C# LINQ, covering syntax, predicate behavior, deferred execution, and practical performance considerations.

LINQC#FilteringQuery Syntax
A visual metaphor of querying a collection with LINQ, showing a pipeline of data transformation steps.
C#

C# LINQ Usage: Practical Patterns and Performance

Practical LINQ usage in C#: query vs method syntax, deferred execution, common operations, and performance tradeoffs for real applications.

LINQC#.NETQuery Syntax
A diagram showing a publisher class raising an event that multiple subscriber classes handle, illustrating the C# publisher subscriber pattern.
C#

C# Publisher Subscriber Pattern: Events in Practice

c# publisher subscriber pattern: Learn how the C# publisher subscriber pattern works with events and delegates, including exception handling, memory leaks, and threadi...

C#EventsDelegatesDesign Patterns
Illustration of a C# event being safely invoked with a null-conditional operator, showing a delegate reference being checked before invocation.
C#

C# Event Null Check: Safe Invocation Patterns

c# event null check: Learn how to safely check and invoke C# events to avoid NullReferenceException, including thread-safe patterns and the null-conditional operator.

C# eventsNullReferenceExceptionThread safetyDelegate invocation
Diagram showing a C# event being raised from a class to multiple subscriber methods.
C#

Raising Events in C#: Syntax, Safety, and Common Pitfalls

Raising events in C#: declare and invoke them safely, pass custom event arguments, handle no subscribers, and avoid common pitfalls that break production code.

C# eventsevent invocationdelegatesthread safety
Illustration of a C# event with a custom EventArgs class carrying data between sender and handler.
C#

C# Custom EventArgs: Passing Data with Events

c# custom eventargs: Learn how to create custom EventArgs classes in C# to pass structured data with events, including design rules and memory behavior.

C#EventsEventArgsEvent Handling
Illustration of a C# event handler connecting a publisher and subscriber with a delegate arrow.
C#

C# EventHandler: Events, Subscriptions, and Pitfalls

Learn how to declare, raise, and subscribe to events with C# EventHandler, including custom event args, thread safety, exception isolation, and avoiding memory leaks.

C# EventsEventHandlerDelegates.NET
Diagram comparing C# event and delegate access and invocation rules
C#

C# Event vs Delegate: Key Differences

C# event vs delegate: Understand the technical difference between C# events and delegates, including invocation rules, assignment restrictions, and when to use each.

C#EventsDelegatesMulticast
Illustration of a C# event handler being removed from a publisher to prevent memory leaks.
C#

How to Unsubscribe from C# Events: Syntax and Memory Leak Prevention

Learn how to use -= to unsubscribe from C# events, avoid memory leaks, and manage event handler lifetimes with practical examples.

C# eventsevent handlersmemory leaksdelegates
Illustration of C# event subscription showing a publisher and subscriber connected by a delegate chain, with an emphasis on unsubscription to prevent memory leaks.
C#

C# Event Subscription: Syntax, Pitfalls, and Clean Unsubscription

Learn C# event subscription syntax, why unsubscribing matters, how to avoid memory leaks, and when to use lambda, method group, or weak event patterns.

C#eventsdelegatesmemory leaks