How To

How to fix 'IMvcBuilder' does not contain a definition for 'AddNewtonsoftJson'
By Tan Lee Published on Jun 21, 2024 5.16K

The error message you are seeing, "IMvcBuilder does not contain a definition for AddNewtonsoftJson", typically occurs when you're trying to add Newtonsoft.Json support to an ASP.NET Core MVC application, but the necessary package or using directive is missing.

Windows Management Instrumentation in C#
By Tan Lee Published on Dec 30, 2024 725

This article provides an overview of Windows Management Instrumentation (WMI) technology and demonstrates how to use WMI with the WMI Query Language (WQL) in C#.

How to change ‘Edit Top 200 Rows’ and ‘Select Top 1000 Rows’ in SQL
By Tan Lee Published on Dec 24, 2024 847

In SQL Server Management Studio (SSMS), when you right-click on a table, you can use the context menu to quickly run commands like Select Top 1000 Rows or Edit Top 200 Rows.

How to Encode and Decode URL in C#
By Tan Lee Published on Dec 11, 2024 2.28K

In C#, URL encoding and decoding can be performed using the System.Net.WebUtility class or System.Uri class.

Fixing Invalid Parameter Type in Attribute Constructor
By Tan Lee Published on Dec 21, 2024 690

When attempting to pass a parameter to the constructor of a custom attribute, you may encounter one of the following compiler errors:

Building Your First App with HTMX and .NET - Part II
By Tan Lee Published on Feb 07, 2025 298

In this episode, we’ll enhance our Articles app by adding an article editing feature. Users will be able to edit article details with a clean and responsive interface.

Working with HTMX and Razor Components
By Tan Lee Published on Feb 07, 2025 438

In .NET 8, working with Razor components has become an efficient way to handle HTML rendering in a clean and reusable format.

Getting Started with HTMX
By Tan Lee Published on Feb 07, 2025 419

HTMX is a JavaScript library that lets you integrate AJAX functionality into HTML directly through HTML attributes.

Build a server-side web app with HTMX in C#
By Tan Lee Published on Feb 07, 2025 366

Combine .NET with C# and HTMX for a smooth development experience that delivers dynamic front-end interactivity without any JavaScript.

How to Use HttpClient to GET JSON from API endpoint in C#
By Tan Lee Published on Jan 09, 2025 701

Why not create a method that can make a GET request to an API and directly return the response as an object?

JWT Token Expiry Timestamp in C#
By Tan Lee Published on Jan 10, 2025 862

To decode a JWT token and extract its expiration time (expiry), you can follow these steps in C#.

How to Send x-www-form-urlencoded Data with HttpClient in C#
By Tan Lee Published on Jan 09, 2025 1.12K

To post x-www-form-urlencoded data in C# using HttpClient, you can follow these steps: