Best of C#January 2025

  1. 1
    Article
    Avatar of medium_jsMedium·1y

    HTTP Client in C#: Best Practices for Experts

    This guide explores advanced best practices for using `HttpClient` in C#. It covers the creation of `HttpClient` instances using various methods like constructors, static instances, `IHttpClientFactory`, named, typed, and generated clients. The article also discusses middleware techniques, resilient handling of HTTP requests using timeout, retries, and circuit-breakers, and efficient ways to issue requests and handle responses while optimizing performance to avoid common pitfalls like port exhaustion and DNS changes.

  2. 2
    Article
    Avatar of devtoDEV·1y

    Learn ASP.NET from Scratch

    Learn ASP.NET Core through a 17-module structured learning path. This guide assumes a basic knowledge of C# and covers topics such as the dotnet CLI, ASP.NET application structure, dependency injection, creating APIs, connecting to PostgreSQL, understanding MVC, using Razor views, and more. Each module comes with specific goals and curated resources to help you master ASP.NET Core development.

  3. 3
    Article
    Avatar of godotGodot·1y

    Godot C# packages move to .NET 8

    Godot 4.4 will now target .NET 8, updating from .NET 6 which ends support in November 2024. Existing Godot projects will be automatically upgraded to target .NET 8 when opened with Godot 4.4. Users are encouraged to upgrade to the latest version of Godot to benefit from the latest fixes and improvements.

  4. 4
    Article
    Avatar of communityCommunity Picks·1y

    .NET Digest #5

    The latest .NET Digest introduces .NET 9, released on November 12, featuring numerous performance and security improvements. Highlights include new params collections in C# 13, nullable reference types in F# 9, and significantly faster package restores with the new NuGet resolver. Articles cover top .NET blog posts, the .NET Aspire Community Toolkit, and notable bugs in C# projects detected in 2024. It also discusses updates in tools like PVS-Studio, dotCover, dotMemory, dotPeek, dotTrace, and ReSharper.

  5. 5
    Video
    Avatar of stefanmischookStefan Mischook·1y

    Java vs C# in 2025 - Which One Would I Choose?

    The author prefers C# over Java due to its versatility. C# is seen as more flexible, especially in game development with Unity, web development using ASP.NET Core, and desktop applications on Windows. Java is strong in enterprise-level server-side applications but lacks the same level of versatility as C#, particularly in modern development scenarios. The author encourages developers to be language agnostic and choose the best tool for the task at hand.

  6. 6
    Article
    Avatar of elmahelmah.io·1y

    Comparing Records, Structs, and Classes in C#: When to Use What?

    C# offers three main type declarations: classes, structs, and records. Classes are reference types that support object-oriented principles and are ideal for complex data objects. Structs are value types meant for simple, lightweight data structures with no inheritance, making them efficient for value-based comparisons. Records, introduced in C# 9.0, combine features of both classes and structs; they are immutable reference types and provide concise syntax for type declarations. Each type serves distinct scenarios and optimizes specific use-cases.

  7. 7
    Article
    Avatar of milanjovanovicMilan Jovanović·1y

    Implementing AES Encryption With C#

    Learn how to implement AES encryption in .NET with practical code examples for both encryption and decryption. Understand the differences between symmetric and asymmetric encryption, and get insights into secure key management and best practices for protecting sensitive data like API keys and database credentials.

  8. 8
    Article
    Avatar of communityCommunity Picks·1y

    Bugs and suspicious places in .NET 9 source code

    The post highlights various bugs and suspicious code fragments found in the .NET 9 source code, analyzed using the PVS-Studio static analyzer. It describes specific instances of incorrect usage, such as improper reference comparisons, potential NullReferenceExceptions, and logical errors, explaining how these issues can affect the code. The post encourages developers to use static analysis tools to detect and fix bugs in their projects.

  9. 9
    Video
    Avatar of communityCommunity Picks·1y

    Event Sourcing for .NET Developers: From Zero to Implementation

    Event sourcing is a design pattern where changes in a domain are stored as immutable events in an append-only log. By focusing on events instead of state, event sourcing allows the reconstruction of current state through replaying events. Key concepts include events, streams, and projections. The tutorial covers implementing an event-sourced bank account aggregate in .NET, detailing event creation, application, and replaying events to achieve current state.