Best of C#June 2024

  1. 1
    Article
    Avatar of devtoDEV·2y

    Understanding IQueryable<T> in C#

    Understanding IQueryable<T> in C# is crucial for efficient data querying. This interface, integral to LINQ, supports deferred execution and expression trees, enabling optimized and flexible queries over data sources like SQL databases or in-memory collections. It allows for method chaining to build complex queries and can be extended using custom extension methods for functionality like filtering, sorting, and pagination.

  2. 2
    Article
    Avatar of tilThis is Learning·2y

    7 Open Source Projects You Should Know - C# Edition ✔️

    Discover seven noteworthy open source projects developed in C#. The projects include QuestPDF for PDF generation, ShareX for screen capture, OpenRA as a real-time strategy game engine, Uno Platform for building multi-platform applications, QRCoder for generating QR codes, Windows Auto Dark Mode for theme switching, and Ryujinx, a Nintendo Switch emulator. Each project offers unique functionalities, from improving productivity to supporting game development.

  3. 3
    Article
    Avatar of hnHacker News·2y

    The .NET Programmer's Playground

    LINQPad offers interactive querying for databases in LINQ and SQL. It generates association properties automatically, making data access simple. LINQPad supports various databases, caches intermediate results, and features a Dump method for intelligent object inspection. It supports advanced C# features, acts as a rapid coding tool, and offers functionalities such as benchmarking and Excel export. LINQPad also includes a tutorial and numerous example queries, making it easy to learn.

  4. 4
    Article
    Avatar of devtoDEV·2y

    Cancellation Tokens in C#

    Learn about cancellation tokens in C# and how they are used to cancel operations before they are completed. See real-world examples of cancellation token usage in scenarios like web requests and database queries.

  5. 5
    Article
    Avatar of communityCommunity Picks·2y

    Result Pattern

    The Result Pattern provides a structured method for dealing with errors in C#. It promotes clearer code and allows for more precise control over error handling. Using the Result Pattern can improve performance compared to using exceptions, especially in situations where errors occur frequently.

  6. 6
    Article
    Avatar of mwaseemzakirWaseem .NET Newsletter·2y

    EP 62 : Dependency Injection Explained in .NET

    Dependency injection is a programming technique in which an object receives other required objects instead of creating them internally. Benefits of dependency injection include automatic handling of object creation and disposal, easy unit testing, and adaptability to changes without affecting existing code. Dependency injection can be implemented using the singleton, transient, or scoped approach.

  7. 7
    Article
    Avatar of devtoDEV·2y

    Push your skills

    Learn how to become a better developer by continuously improving your skills. Use resources like Pluralsight and Microsoft Learn, read documentation, keep things simple, use version control with GitHub, and prioritize learning over speed. Microsoft Visual Studio is recommended for coding, along with tools like Red Gate SQL Prompt and EF Power Tools. Dive into code basics with Microsoft Entity Framework Core or Dapper. Refactor code and incorporate best practices like using meaningful variable names and writing readable code. Continually learning is essential for growth as a developer.

  8. 8
    Article
    Avatar of codemazeCode Maze·2y

    Proxy Design Pattern in C#

    The proxy design pattern adds an extra layer of control over access to an object through a wrapper object (proxy) that acts on behalf of the original object (real subject). This pattern allows additional logic without modifying the original object's functionality. Use cases include caching, logging, protection, remote services, and conditional service resolution. While the pattern offers multiple benefits, it introduces complexity and potential maintenance overhead, particularly with asynchronous or multithreaded operations.

  9. 9
    Article
    Avatar of codemazeCode Maze·2y

    Flattening Nested Collections in C#

    Explore different approaches for flattening nested collections in C#. Learn how to use the Select() method to flatten specific properties and the SelectMany() method to flatten multiple nested collections.

  10. 10
    Article
    Avatar of codemazeCode Maze·2y

    The Semaphore Class in C#

    The post introduces the Semaphore class in C# and compares it with the SemaphoreSlim class. It explains semaphore initialization, usage, and best practices for synchronization in multithreading. Named semaphores, which synchronize threads across processes, are also discussed. Examples with code demonstrate semaphore operations, and guidelines for avoiding common pitfalls like deadlocks are provided.

  11. 11
    Article
    Avatar of codemazeCode Maze·2y

    What Does the null! Statement Do?

    The null! statement in C# is used to suppress the CS8618 warning, which indicates that a non-nullable reference type property might be null. By attaching the null-forgiving operator (!) to null, it marks a nullable type as non-nullable, bypassing compiler warnings. While useful for certain scenarios, developers should use it sparingly as it doesn't prevent runtime NullReferenceExceptions.

  12. 12
    Article
    Avatar of ayendeAyende @ Rahien·2y

    Recording: Building a Database Engine in C# & .NET

    Oren Eini, CEO of RavenDB, explores the process of building a database engine with C# and .NET, highlighting the language's capabilities for high-end system development. This session covers direct memory access, fine-grained control, and the blend of high-level concepts with low-level programming offered by C#.

  13. 13
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Don't Use Polly in .NET Directly. Use this instead!

    Learn how to add resilience to your .NET applications by using the Microsoft.Extensions.Http.Resilience package. This package allows you to easily handle exceptions, retry requests, and set timeouts for your HTTP requests.

  14. 14
    Article
    Avatar of dotnet.NET Blog·2y

    Refactor your code using alias any type

    Learn how to refactor your code using the alias any type feature in C# 12. This feature allows you to create an alias for any type with the using directive, making your code more readable and maintainable.