C# Digest - The "Weak Event" Pattern in C#

#470 – September 04, 2023 View in browser

C# Digest

The "Weak Event" Pattern in C#

Events in C# are a powerful mechanism for decoupling components and enabling a publisher/subscriber model. However, they have a significant drawback: the publisher holds a strong reference to the subscriber, and this can cause memory leaks. This article describes a pattern for implementing weak events in C#.

Workshop: How to migrate a legacy app to Blazor (sponsor)

Join Ed Charbeneau for a live application-building workshop, where you’ll migrate an existing .NET Web Forms application to Blazor in real time. Learn how to avoid potential roadblocks and master the basic concepts behind .NET 7 and Blazor.

Not all O(1) operations are considered equal

One of the most powerful optimization techniques is to use a cache, which is usually implemented as a dictionary. Today’s tale is about a dictionary, but surprisingly enough, not about a cache.

BearerToken: The new Authentication handler in .NET 8

In ASP.NET Core 8, Microsoft added a new authentication handler named BearerToken. In this blog post, I will explain how it works and its purpose. This handler is part of a bigger push by Microsoft to simplify authentication in ASP.NET Core, but in this blog post, we will focus on this handler.

Reasoning Task, Async & Await in .NET

As developers, we often encounter situations where we need to perform tasks concurrently to ensure our applications run efficiently. The asynchronous programming model in .NET brings us the powerful trio: Task, async, and await. In this post, we'll unravel the mysteries behind these concepts and explore how they enable parallel execution, providing a clear understanding of how they work together.

Measuring Unicode String Lengths with C#

In this short post, we’ll see how you can calculate the actual length of a string using the StringInfo class and why writing to the console might be one of the most complex technical challenges of our time. Well, maybe not, but it’s still damn hard.

"Parse, don't validate" and other type safety driven shenanigans

Making use of the type system is something I feel should be important when working in a strongly typed language like C#. However, I don't feel like that's the case, and I would love for the language to push folks in the direction of creating more robust programs, where the compiler provides more help in proving the correctness of the code.

Free up resources with cancellation while accessing APIs using HTTPClient

In this post I will teach how to free up resources with cancellation while accessing APIs using HTTP Client. All with live working demo.

how did you like this issue?

Amazing · Great · Okay · Meh · Bad

newsletters

© 2023 Bonobo Press

Would you like to advertise with us? Check out our latest media kit for more information.
If you no longer wish to receive these emails, click to unsubscribe.

Older messages

Struct memory layout optimizations

Sunday, August 27, 2023

We could store the exact same information in several ways, leading to space savings of 66% #469 – August 28, 2023 View in browser C# Digest Struct memory layout optimizations, practical considerations

Tales from the .NET Migration Trenches

Sunday, August 20, 2023

Messy aspects of migration that crop up when you've got an old codebase #468 – August 21, 2023 View in browser C# Digest Tales from the .NET Migration Trenches There are quite a few "how-to

.NET 8 Interceptors

Monday, August 14, 2023

Interceptors allow developers to target specific method invocations and intercept them with a new implementation #467 – August 14, 2023 View in browser C# Digest .NET 8 Interceptors As the name implies

How to benchmark different .NET versions

Sunday, August 6, 2023

With the famous BenchmarkDotNet library you can benchmark a lot #466 – August 07, 2023 View in browser C# Digest How to benchmark different .NET versions With the famous BenchmarkDotNet library you can

A Comprehensive Guide for Efficient Data Binding

Sunday, July 30, 2023

Basics of binding data to the Repeater, customizing the layout, and handling events #465 – July 31, 2023 View in browser C# Digest A Comprehensive Guide for Efficient Data Binding Learn how to use the

You Might Also Like

Charted | The Pyramid of S&P 500 Returns (1874-2024) 💰

Tuesday, January 7, 2025

In 2024, the S&P 500 surged 23%, setting a series of record highs. We show these returns in a historical context spanning 150 years. View Online | Subscribe | Download Our App Presented by: Global

LW 164 - How to create new arrivals collection in Shopify using Shopify Flow    

Tuesday, January 7, 2025

How to create new arrivals collection in Shopify using Shopify Flow ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ Shopify Development news and

Tic-Tac-D’Oh 💻

Tuesday, January 7, 2025

The latest from the dull side of the internet. Here's a version for your browser. Hunting for the end of the long tail • January 07, 2025 Tic-Tac-D'Oh Dell decides to rebrand its machines along

Spyglass Dispatch: CaptAIn AmerIca...

Tuesday, January 7, 2025

Hulu, Fubo, Venu • NVIDIA's Cosmos • NVIDIA's DIGITS • Meta's Board Addition • Meta's Fact-Checking Subtraction • Dude, You're Getting a Dell Pro Max Premium The Spyglass Dispatch

DeveloPassion's Newsletter #183 - Knowledge Management for All

Tuesday, January 7, 2025

A newsletter discussing Knowledge Management, Knowledge Work, Zen Productivity, Personal Organization, and more! Sébastien Dubois DeveloPassion's Newsletter DeveloPassion's Newsletter #183 -

CES 2025 ICYMI: 8 top reveals so far

Tuesday, January 7, 2025

Bluesky's most-needed feature; A mulching robot mower; Linux man pages -- ZDNET ZDNET Tech Today - US January 7, 2025 ces55gettyimages-2191705850 CES 2025: ZDNET's 8 most impressive products we

Post from Syncfusion Blogs on 01/07/2025

Tuesday, January 7, 2025

New blogs from Syncfusion Introducing the New Blazor Chat UI Component By Silambarasan Ilango Enhance real-time communication with the Blazor Chat UI. Discover its features and use cases for creating

⚙️ The ethics of AI

Tuesday, January 7, 2025

Part 2 of a special edition series ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Issue 163

Tuesday, January 7, 2025

🔬 🧪 Can nanotechnology finally deliver on its promise? Creating space's first artificial eclipse factory. PayPal's Honey app: sweet savings or digital sleight of hand? ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

New EAGERBEE Variant Targets ISPs and Governments with Advanced Backdoor Capabilities

Tuesday, January 7, 2025

THN Daily Updates Newsletter cover JavaScript: Mastering JavaScript from Basics to Advanced Topics ($54.99 Value) FREE for a Limited Time This book provides a comprehensive introduction to JavaScript