Take advantage of the DinkToPdf and wkhtmltopdf libraries to generate PDF documents from HTML templates in ASP.NET Core 5.
Take advantage of init-only setters to make configuration options immutable in ASP.NET Core MVC 5 to avoid unnecessary assignments and eliminate opportunities for errors.
Learn how to use constructor injection, property injection, method injection, and the service locator pattern in ASP.NET Core MVC 5, along with their caveats.
Understand the differences between a singleton class and a static class and when to use which in your applications.
Handle unknown actions elegantly in ASP.NET 5 by creating routes that dynamically map to the views in your application.
Overloading action methods that use identical HTTP verbs is tricky in ASP.NET Core 5, but there are a number of ways to do it. Let’s explore them.
Take advantage of the Windows Event Log to store the log data of your .NET Core applications running on Windows
How to register multiple implementations of an interface with the IoC container in ASP.NET Core and retrieve a specific service at runtime.
Take advantage of Microsoft.IO.RecyclableMemoryStream to eliminate LOH allocations and avoid memory fragmentation and memory leaks in your .NET Core applications.
Take advantage of array pooling and memory pooling in C# to reduce allocations and improve the performance of your applications
Take advantage of the Buffer class in .NET to improve application performance through faster access to data in memory
Take advantage of high-performance HashSet collections for storing unique elements to speed up searches in your applications.
Take advantage of IHttpClientFactory to create HttpClient instances seamlessly and avoid having to manage their lifetimes manually
Take advantage of the open source ProblemDetails middleware in ASP.NET Core to send clients standardized, machine-readable error messages when exceptions occur
You can take advantage of custom route constraints in ASP.NET Core to validate route values and avoid passing unwanted or unnecessary requests to action methods.
Take advantage of user secrets management in ASP.NET Core to prevent the sharing of sensitive application data in your projects
Take advantage of named and optional parameters in C# for improved readability, flexibility, and COM interoperability
Take advantage of the lightweight, open source BenchmarkDotNet library to benchmark your methods and track their performance.
Take advantage of fluent interfaces and method chaining to make your code simple, readable, and understandable
Learn how to use gRPC, a language-agnostic, high-performance RPC framework, to build lightweight, high-performance services in ASP.NET Core 3.0
Learn when static methods can’t be unit tested and how to use wrapper classes and the Moq and xUnit frameworks to unit test them when they can
Take advantage of redirect action results in ASP.NET Core MVC to elegantly redirect a request to a specified URL
Follow these best practices to eliminate God objects and design classes that are loosely coupled, cohesive, and easy to maintain
Take advantage of attribute-based routing in ASP.NET Core to decouple the controller and action names from the route template and allow more flexibility in your routing.
Explore the various ways in which you can pass parameters to action methods in ASP.NET Core MVC
Take advantage of API Analyzers and Swagger to improve the documentation of your ASP.NET Core APIs
Take advantage of data tokens in ASP.NET Core to attach additional information to a route and retrieve it programmatically when needed
Take advantage of ValueTask in C# to avoid allocation when returning task objects from an asynchronous method
Learn the importance of immutability and how to take advantage of it in your C# applications
Take advantage of API versioning in ASP.NET Core to manage the impact of changes to your APIs on your clients
Learn the benefits of Data Transfer Objects, why they should be immutable, and how to take advantage of them in your ASP.NET Core applications
Understand the similarities and differences between the const, readonly, and static keywords in C#
Take advantage of ASP.NET Core middleware to handle 404 errors more gracefully in ASP.NET Core MVC
Take advantage of dependency injection to make your action methods in ASP.NET Core lean, clean, and maintainable
Take advantage of data annotations to decorate your models using attribute tags so that your application’s data definition can be managed in a single place.
Take advantage of the options pattern to load configuration data directly into your classes at runtime for simple and flexible configuration data management
Learn how to implement endpoint routing in ASP.NET Core 3.0 MVC to bring more flexibility and functionality to your applications
Take advantage of GUIDs to create universally unique identifiers and avoid data collisions in your applications
Learn how to use the ClosedXML NuGet package to export data as a CSV or XLSX file for Excel from an ASP.NET Core application.
Take advantage of anonymous types in C# to create and instantiate types that have read-only properties without having to declare the type beforehand
Take advantage of high-performance logging by using LoggerMessage instead of Logger extension methods in ASP.NET Core
Take advantage of the open source MailKit library to send emails in ASP.NET Core easily.
Take advantage of indices and ranges in C# 8.0 to access elements or slices of a collection with simplicity and ease
Take advantage of the open source library Serilog to log your ASP.NET Core application’s data to SQL Server or another database target.
Take advantage of the ability to create and consume data streams asynchronously in C# 8.0 to improve the performance of your applications.
Take advantage of a Quartz.NET hosted service to schedule background jobs in your ASP.NET Core application.
Take advantage of ValueTuples to return multiple values from a method with better performance than Tuples.
Take advantage of the inversion of control pattern to loosely couple the components of your application and make them easier to test and maintain.
Learn the three ways you can return data from your ASP.NET Core Web API action methods.
Take advantage of pattern matching improvements in C# 8.0 to write code that is more readable, maintainable, and efficient