Best of .NETJuly 2024

  1. 1
    Article
    Avatar of ardalisArdalis·2y

    From Microservices to Modular Monoliths

    Struggling with the complexity of microservices? Consider migrating to a modular monolith. This approach maintains the gains from breaking up a legacy system without dealing with the issues of a massively distributed system. A modular monolith can simplify management, reduce latency, and keep communication efficient among well-defined modules. However, such a migration needs careful planning and execution.

  2. 2
    Article
    Avatar of milanjovanovicMilan Jovanović·2y

    Building Your First Use Case With Clean Architecture

    Learn how to design a user registration feature using Clean Architecture principles, focusing on the dependency rule to decouple business logic from external dependencies. Clean Architecture emphasizes separation of concerns, making systems more maintainable and testable. The practical guide covers defining use cases, managing dependencies, handling race conditions, and updating hashing algorithms.

  3. 3
    Article
    Avatar of freecodecampfreeCodeCamp·2y

    How To Use LINQ in C# – With Code Examples

    LINQ, part of the .NET framework, allows for powerful data querying through both language-level query syntax and method syntax. This post covers various LINQ methods such as `OrderBy`, `First`, `Single`, `SingleOrDefault`, and `Select` with examples on how to apply them. It also delves into deferred execution and method chaining, demonstrating how LINQ can optimize performance and allow for more complex, readable queries. Writing defensive code to handle changes in data over time is emphasized for error prevention.

  4. 4
    Article
    Avatar of devtoDEV·2y

    Part 2 :Design Principles in Software Development

    Adhering to fundamental design principles in software development—such as Dependency Inversion, Separation of Concerns, Single Responsibility, DRY (Don't Repeat Yourself), and Persistence Ignorance—is key to creating robust, maintainable, and scalable applications. Each principle contributes to keeping the codebase clean and efficient, which in turn simplifies maintenance and extension of the software.

  5. 5
    Article
    Avatar of aspnetASP.NET Blog·2y

    C# 13: Explore the latest preview features

    C# 13 introduces new features focusing on flexibility, performance, and enhancing everyday use. Key updates include enhancements to params collections, new lock object improvements for mutual exclusion, index operator improvements, a new escape sequence for the ESC character, and the introduction of partial properties. Additionally, there are enhancements to method group natural type determination and relaxed restrictions for ref and unsafe contexts in async methods and iterators. The preview can be tried with the latest .NET 9 and Visual Studio 2022 updates.

  6. 6
    Article
    Avatar of habrhabr·2y

    Spans in C#: Your Best Friend for Efficient Coding

    Spans in C# provide a powerful way to handle memory efficiently, reducing allocations and improving performance. They allow for direct manipulation of memory regions, support safe code practices, and are stack-allocated. This guide covers their use, differences between Span<T> and ReadOnlySpan<T>, and practical examples, including JSON parsing, converting arrays, and strings to spans. Ensuring proper scope and compatibility with development environments is crucial for optimal use.

  7. 7
    Article
    Avatar of codemazeCode Maze·2y

    How to Read appsettings.json in a .NET Console Application

    Learn how to read and manage configuration settings using the appsettings.json file in a .NET console application. This guide covers adding the appsettings.json file to your project, installing necessary NuGet packages, setting up ConfigurationBuilder to read the JSON file, and accessing configuration sections either through key specification or binding to strongly typed objects. This ensures maintainability and flexibility in managing environment-specific configurations.

  8. 8
    Article
    Avatar of communityCommunity Picks·2y

    Introduction to Microservices with .NET 8

    Explore the fundamental concepts of microservices with .NET 8, including Clean Architecture principles, design, development, and deployment of microservices. Learn about scalability, maintainability, flexibility, resilience, and faster deployment benefits, with practical examples like e-commerce platforms and inventory management systems.

  9. 9
    Article
    Avatar of csharpcornerC# Corner·2y

    Differences Between IEnumerable and IQueryable in C#

    Understanding the differences between IEnumerable and IQueryable in C# is crucial for optimal data manipulation and querying. IEnumerable is used for in-memory data collections and supports deferred execution, while IQueryable is designed for remote data querying and can be translated into query languages like SQL. Using IEnumerable is best for local data collections, whereas IQueryable is ideal for querying large external data sources efficiently.

  10. 10
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Don’t Use UUIDs/GUIDs in Databases. Use this Instead

  11. 11
    Article
    Avatar of medium_jsMedium·2y

    Hidden Gems of .NET: Tricks and Features Every Developer Should Know

    Discover some lesser-known features and tricks in .NET that can significantly enhance your development experience. Learn about global using directives, string interpolation enhancements, Span<T>, top-level statements, source generators, file-scoped namespaces, nullable reference types, custom attributes, records, and .NET Interactive Notebooks.

  12. 12
    Article
    Avatar of csharpcornerC# Corner·2y

    Discard Variable in C# .NET

    The discard variable, introduced in C# 7.0 and represented by an underscore (_), is a special, read-only variable used to ignore values intentionally. This feature can lead to more readable and maintainable code by avoiding unnecessary variables. Common usage scenarios include deconstructing tuples, pattern matching, handling out parameters, and optimizing LINQ queries. The discard variable enhances code clarity and can aid in performance optimization by reducing memory usage.

  13. 13
    Article
    Avatar of snykSnyk·2y

    Preventing SQL injection in C# with Entity Framework

    SQL injection (SQLi) is a severe security threat that happens when malicious SQL code is injected into user inputs, potentially compromising the database. To avoid SQLi, it's crucial to avoid using string concatenation for SQL queries. Instead, Entity Framework (EF) offers secure options: LINQ for most queries, FromSqlInterpolated for raw SQL using string interpolation, and FromSqlRaw when explicit parameters are defined. Tools like Snyk Code can help detect unsafe code during development.

  14. 14
    Article
    Avatar of bartwullemsThe Art of Simplicity·2y

    Debug your .NET 8 code more efficiently

    The latest update to .NET 8 introduces significant improvements to debugging experiences, including an enhanced debug summary for `HttpContext` compared to .NET 7. Importantly, you can now debug .NET 8 applications with minimal performance impact on the rest of your code by disabling the Just My Code option in Visual Studio.

  15. 15
    Video
    Avatar of nickchapsasNick Chapsas·2y

    ToArray vs ToList | .NET Tips 9

  16. 16
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Discriminated Unions Are Finally Coming in C#

  17. 17
    Article
    Avatar of auth0Auth0·2y

    Use Private Key JWTs to Authenticate Your .NET Application

    Sensitive operations require robust security mechanisms, and Private Key JWT authentication offers a secure method for applications to obtain security tokens from an authorization server. It uses asymmetric cryptography, where a private key is stored securely by the application and a corresponding public key is shared with Auth0. This method is suitable for high-security environments like finance and healthcare. The post provides a detailed guide on implementing Private Key JWT in a .NET application using Auth0, including sample code and steps for key generation, configuration, and credential rotation.

  18. 18
    Article
    Avatar of csharpcornerC# Corner·2y

    Strategy Pattern in .NET 8.0 Minimal API with Dependency Injection

    Explore how to implement the Strategy pattern in .NET 8.0 using Minimal API and dependency injection. Learn to create a flexible and maintainable payment processing system by encapsulating multiple payment method algorithms, defining a strategy interface, implementing concrete strategies, setting up payment context, configuring the Minimal API with dependency injection, and testing the endpoint.

  19. 19
    Article
    Avatar of codemazeCode Maze·2y

    Using EF Core Interceptors in .NET

    EF Core Interceptors allow the insertion of custom behavior at various stages of the data interaction pipeline, enhancing control over database operations. This includes monitoring, logging, modifying, or canceling operations during Saves, Commands, Transactions, and Connections. Extensible through abstract base classes, they enforce business rules and ensure data integrity with minimal boilerplate code. This guide covers setting up interceptors using Docker and Testcontainers, culminating in a practical user registration example with entity auditing and email notifications.

  20. 20
    Article
    Avatar of omgubomg! ubuntu!·2y

    DevToys (Developer Tools App) is Now Available for Linux

    DevToys, an open-source app described as a 'Swiss Army knife for developers', is now available for Linux. It includes 30 tools for developers such as converters, encoders/decoders, formatters, generators, graphics tools, testers, and text helpers. The app features smart detection, a CLI version, and is extensible. The development journey from a Windows-only app to a cross-platform tool was discussed by the developer, highlighting the challenges of building a .NET app for multiple OSes. Users can download the app from the DevToys GitHub releases page or website, with DEB installer or binary build options available for Ubuntu users.

  21. 21
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Give your Strings Meaning | .NET Tips 11

  22. 22
    Video
    Avatar of nickchapsasNick Chapsas·2y

    The Logging Everyone Should Be Using in .NET

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

    Add AI to Your .NET Apps Easily with Prompty

    Prompty is a Visual Studio Code extension developed by Microsoft that simplifies the integration of Large Language Models like GPT-4o into .NET applications. It provides an intuitive interface for developers, making it easier to incorporate AI features into projects. The post guides through the installation, setup, and usage of Prompty, including a practical example with a .NET WebAPI application to generate detailed weather forecasts using AI. Prompty streamlines code generation, documentation creation, and debugging with AI, enhancing productivity for .NET developers.

  24. 24
    Article
    Avatar of communityCommunity Picks·2y

    .NET Digest #1

    The post provides a roundup of the latest updates in the .NET ecosystem, including the .NET 9 Preview 5, a new OpenAI library for .NET, the general availability of the .NET MAUI extension for Visual Studio Code, and performance enhancements in Visual Studio 2022 version 17.10. It also features video recommendations and articles on various related topics, including C# 12 features, UI testing for .NET MAUI apps, and caching in ASP.NET Core. Additionally, new releases of Rider, ReSharper, and PVS-Studio are covered.

  25. 25
    Article
    Avatar of techworld-with-milanTech World With Milan·2y

    New Learning Resources, Updated Articles, and Archive

    Tech World With Milan Newsletter celebrates rapid growth to 33,000 subscribers and offers a comprehensive guide to navigating its learning resources. Key points include the introduction of new resources like updated books and templates, detailed learning tracks covering over 25 topics in software engineering, and continual updates to articles with new knowledge. It also outlines future plans for courses on personal productivity and increasing reach on social networks.