Best of .NETJune 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 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.

  3. 3
    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.

  4. 4
    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.

  5. 5
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Forget Controllers and Minimal APIs in .NET!

    Learn how to get started with building APIs in .NET using the alternative to controllers and minimal APIs called Fast End Points. Fast End Points is a developer-friendly alternative that nudges you towards the request and response pattern and offers better performance than controllers. Discover the basic registration process and how to implement endpoints for getting all movies, getting a single movie, and creating a movie.

  6. 6
    Article
    Avatar of infoworldInfoWorld·2y

    6 security best practices for ASP.NET Core

    Learn about 6 security best practices for ASP.NET Core, including enforcing HTTPS, using HSTS, preventing CSRF attacks, thwarting XSS attacks, preventing SQL injection, and creating custom error pages.

  7. 7
    Article
    Avatar of amplicationAmplication·2y

    Backend Development with AI-Powered .NET Code Generation

    Amplication has expanded its backend development platform to support full AI-powered .NET code generation. This solution helps developers handle and update legacy code, integrate with Microsoft tools, meet compliance and security standards, and adhere to enterprise best practices. It offers features such as AI-powered code generation, configurable data models, CRUD and custom APIs generation, scalable architecture, authentication and authorization support, and integration with popular tools and services.

  8. 8
    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.

  9. 9
    Article
    Avatar of faunFaun·2y

    .NET Application Development: Myths and Benefits

    The .NET framework, developed by Microsoft, is renowned for its versatility and ease of use in building web applications across various platforms. It offers numerous benefits such as secure applications, code reduction, support for multiple languages, and cross-platform capabilities. Despite common myths, .NET is cost-effective, reliable, and suitable for both small and large-scale projects.

  10. 10
    Article
    Avatar of codemazeCode Maze·2y

    Multitenancy in .NET With Orchard Core

    Orchard Core is an open-source platform built on ASP.NET Core, supporting multitenancy to serve multiple customers efficiently. This guide covers the installation and configuration of Orchard Core for multitenant .NET applications, including using the admin dashboard to manage tenants, integrating features and modules, and dynamically creating new tenants. Orchard Core offers both an application framework and a CMS, enabling modular, scalable, and customizable solutions.

  11. 11
    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.

  12. 12
    Article
    Avatar of codemazeCode Maze·2y

    Conditionally Add Middleware in ASP.NET Core

    Learn how to conditionally add middleware in ASP.NET Core applications to adapt behavior based on runtime environment or request details. Techniques include using the IWebHostEnvironment interface for environment-based conditions, the UseWhen() extension method for custom predicates, and the MapWhen() extension method to split the request pipeline. Understand when to use each method and how to apply them effectively.

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

    What You Need To Know About EF Core Bulk Updates

    EF Core bulk update methods, ExecuteUpdate and ExecuteDelete, significantly improve performance by bypassing the ChangeTracker and executing raw SQL directly. While this enhances efficiency, it introduces potential pitfalls like in-memory and database state inconsistencies. Ensuring consistency often requires wrapping these operations within a transaction to handle possible failures robustly.

  14. 14
    Article
    Avatar of devblogsDevBlogs·2y

    Building Generative AI apps with .NET 8

    Build Generative AI apps with .NET 8 and easily integrate language models. Increase user engagement, boost productivity, create new business opportunities, and gain a competitive edge. Get started with AI development using .NET, explore Semantic Kernel for simplified AI solutions, and discover a growing ecosystem of AI tools and services for .NET developers. Learn from H&R Block's experience in building AI solutions with .NET.

  15. 15
    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.

  16. 16
    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#.

  17. 17
    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.

  18. 18
    Article
    Avatar of codemazeCode Maze·2y

    How to Use the LINQ ToDictionary Method in C#

    Learn how to use the LINQ ToDictionary() method in C# to convert enumerables into dictionaries. Explore different overloads of the method and scenarios where it can be useful.

  19. 19
    Video
    Avatar of nickchapsasNick Chapsas·2y

    The Feature That Will Break Your Code in C# 13

    The post discusses a new feature coming in C# 13 called semi-auto properties or the 'field' keyword in properties. It explains how the feature works and the challenges in adding it.

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

    Announcing the official OpenAI library for .NET

    Microsoft announced the official OpenAI library for .NET at Microsoft Build 2024. The library has support for the entire OpenAI API, including Assistants and Chat Completions. It also includes support for GPT-4o, OpenAI's latest flagship model, and provides sync and async APIs for ease of use and efficiency. The library is developed and supported on GitHub and will be kept up to date with the latest features from OpenAI. The .NET community is also thanked for their contributions.

  21. 21
    Video
    Avatar of nickchapsasNick Chapsas·2y

    Getting Started with Messaging in .NET with NServiceBus

    This post provides a comprehensive guide on getting started with messaging in .NET using NServiceBus. It explains the basics of messaging, queues, and pub/sub patterns, and demonstrates integrating NServiceBus with RabbitMQ and AWS. The post also includes examples of setting up endpoint configurations, creating message handlers, and switching queuing mechanisms between RabbitMQ and AWS SQS. Additionally, it provides insights into the pros and cons of NServiceBus compared to other libraries like Mass Transit.

  22. 22
    Article
    Avatar of codemazeCode Maze·2y

    ExecuteAsync() and StartAsync() in .NET BackgroundService

    This post compares the ExecuteAsync() and StartAsync() methods of the BackgroundService class in .NET Core. It explains the concept of BackgroundService and provides insights into the uses of these methods. The post also includes an example of a .NET application that utilizes these methods to handle stock price data.

  23. 23
    Video
    Avatar of communityCommunity Picks·2y

    Master Claims Transformation for Flexible JWT Auth in ASP.NET Core

    Learn about claims transformation in ASP.NET Core, how it extends user claims, and its role in the authentication process.

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

    EP 61 : Custom Type Handling with Dapper in .NET

    Learn how to handle complex types with Dapper using custom type handlers in .NET.

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

    EP 64 : Service Locator Pattern in .NET

    The service locator pattern in .NET allows for the injection and retrieval of services via a central service provider. It's useful in scenarios where dependency injection isn't feasible, such as dealing with service scope mismatches or updating legacy code. Although practical, it has drawbacks, including testing complications and potential for poor design choices. Direct dependency injection is generally preferred for its cleaner and more manageable structure.