Browse by Topic

Popular

Latest

Latest C# Posts

Illustration of a C# anonymous method represented as an inline delegate block with a closure scope.
C#

C# Anonymous Method: Inline Delegate Logic Explained

Learn how to use anonymous methods in C# for inline delegate logic, including syntax, variable capture, and when lambdas are a better choice.

anonymous methodsdelegateslambda expressionsC# syntax
Illustration of a C# generic delegate as a connector between generic type boxes, with Func, Action, and Predicate icons arranged around it.
C#

C# Generic Delegate: Syntax and Practical Usage

c# generic delegate: Learn how to declare and use generic delegates in C#, including Func, Action, and custom delegate types with compile-time type safety.

C#delegatesFuncAction
Comparison of C# delegate, Action, and Func with code snippets.
C#

C# Delegate vs Action vs Func: Which to Use?

Custom delegates, Action, and Func all let you pass methods around in C#. Learn how they differ and when each one is the clearest choice.

C# DelegatesActionFuncFunctional Programming
Illustration comparing C# Action and Func delegates, showing void versus return value
C#

C# Action vs Func: Choosing the Right Delegate

Understand the difference between Action and Func delegates in C#, including return types, type parameter order, async variants, and practical selection criteria.

C#DelegatesActionFunc
Diagram showing a predicate delegate filtering a list of items in C#
C#

C# Predicate Delegate: Usage and Examples

Learn how to use the C# Predicate<T> delegate to filter collections and express reusable conditions, with syntax, lambda examples, and common pitfalls.

PredicateDelegateLambdaLINQ
Diagram showing a C# Func delegate being passed as a parameter between two code blocks, representing method references and functional composition.
C#

C# Func Delegate: Syntax, Usage, and Practical Examples

Learn how to use the C# Func delegate to pass methods as parameters, write concise lambdas, and build flexible, reusable code.

delegateslambda expressionshigher-order functionsfunctional programming
A visual metaphor for the C# Action delegate showing a callable method box that returns void, with arrows representing input parameters.
C#

C# Action Delegate Usage with Examples

Learn how to use the C# Action delegate to pass methods as parameters, handle callbacks, and write flexible, reusable code with practical examples.

delegateslambda expressionsmethod groupshigher-order functions
Illustration of a C# delegate being invoked with a null-conditional operator, showing method chain and safety check.
C#

How to Invoke C# Delegates Safely

Practical guidance for invoking C# delegates safely: null handling, multicast behavior, exception isolation, return values, and async patterns.

delegatesinvocationnull-conditionalmulticast
Illustration of multiple method references chaining together in a delegate invocation list
C#

C# Multicast Delegate: Syntax and Behavior

Understand how C# multicast delegates chain method calls, how invocation lists behave at runtime, and practical patterns for safe event handlers.

delegateseventsinvocation listexception handling
C# code illustrating passing a method as a parameter using a delegate arrow symbol.
C#

C# Pass Method as Parameter: Delegates and More

Learn how to pass methods as parameters in C# using delegates, Func, Action, and lambdas, with practical examples and tradeoffs.

C# delegatesAction and Funchigher-order functionsevent handling