C#

C# | News, how-tos, features, reviews, and videos

Hacker in hoodie holding up finger to be quiet secret
name badges hello

Spotlights on stage

What’s new in Microsoft .NET 5

Aimed at unifying the .NET platform, .NET 5 brings improvements to RyuJIT code quality, garbage collection, and JSON serialization, for starters

measurements

How to benchmark C# code using BenchmarkDotNet

Take advantage of this lightweight, open source benchmarking library to transform your methods into benchmarks and track their performance

chains

How to use fluent interfaces and method chaining in C#

Take advantage of fluent interfaces and method chaining to make your code simple, readable, and understandable

API security alert / software development / application flow chart diagram

Microsoft .NET 5 adds safe warnings for C#

New AnalysisLevel in the C# compiler introduces warnings for common coding mistakes and other latent bugs in a safe way

network 5 100848391

How to build gRPC applications in ASP.NET Core

Learn how to use gRPC, a language-agnostic, high-performance RPC framework, to build lightweight, high-performance services in ASP.NET Core 3.0

Movie preview test pattern

How to unit test static methods in C#

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

detour sign

How to redirect a request in ASP.NET Core MVC

Take advantage of redirect action results in ASP.NET Core MVC to elegantly redirect a request to a specified URL

weird science 2017universe

How to refactor God objects in C#

Follow these best practices to eliminate God objects and design classes that are loosely coupled, cohesive, and easy to maintain

arrow icon set 106408643

How to use attribute routing in ASP.NET Core

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

relay teamwork coordination cooperation continuity

How to pass parameters to action methods in ASP.NET Core MVC

Explore the various ways in which you can pass parameters to action methods in ASP.NET Core MVC

woman code program monitor screen team

How to use API Analyzers in ASP.NET Core

Take advantage of API Analyzers and Swagger to improve the documentation of your ASP.NET Core APIs

women spinning plates asynchronous programming synchrony multi tasking by graemenicholson getty ima

How to use ValueTask in C#

Take advantage of ValueTask in C# to avoid allocation when returning task objects from an asynchronous method

artsy still life of bowling pins with green bowling ball

How to use immutability in C#

Learn the importance of immutability and how to take advantage of it in your C# applications

square peg in a round hole / wooden block shapes toy

How to use API versioning in ASP.NET Core

Take advantage of API versioning in ASP.NET Core to manage the impact of changes to your APIs on your clients

Network encryption / encrypted data transfers

How to use Data Transfer Objects in ASP.NET Core 3.1

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

question marks / questions

How to use const, readonly, and static in C#

Understand the similarities and differences between the const, readonly, and static keywords in C#

error 404 web browser

How to handle 404 errors in ASP.NET Core MVC

Take advantage of ASP.NET Core middleware to handle 404 errors more gracefully in ASP.NET Core MVC

action

How to use dependency injection in action filters in ASP.NET Core 3.1

Take advantage of dependency injection to make your action methods in ASP.NET Core lean, clean, and maintainable

Load More