Modern security models that presume no implicit confidence include zero-trust architecture (ZTA), which requires constant verification of all requests, users, and devices, regardless of their location. In this post, I describe how to use tried-and-true security concepts and tools to design and implement zero-trust principles in C# services, specifically within ASP.NET Core. What Is Zero-Trust?…
Author: Pablo Francesco
How to Create a WebApi Project in .NET 9?
Step 1: Establish an ASP.NET Core WebApi project using the.NET 9 framework. Step 2. Let’s define the structure by creating the following Class Library Projects. Step 3. Set the database connection string after configuring or using an existing database. Step 4. In the Repos and Models projects, install the NuGet package Microsoft.EntityFrameworkCore, version 9.0.4 at…
Time-Based One-Time Password (TOTP) MFA Implementation in .NET Core
A safe two-factor authentication (2FA) technique called TOTP (Time-based One-Time Password) creates short-lived, one-time codes for user verification. These codes are synchronized with the current time and refresh at predetermined intervals, often every 30 seconds. Compared to static passwords, TOTP improves security by dynamically updating the valid code, which drastically lowers the possibility of unwanted…
Easy Best Practices for.NET Code Performance and Quality
Lets break down some best practices for writing good and fast code in .NET, using simple examples and including important principles that anyone can understand. 1. Follow SOLID Principles The SOLID principles help you write better code. Think of them as rules for building a strong house. Single Responsibility Principle (SRP) Each part of your code…
System.Text.Json in .NET: An explanation
In.NET9, the System.Text.Json package has been greatly improved to give developers more powerful and adaptable JSON processing capabilities. Support for JSON schemas, clever application features, and more customization choices for serialization and deserialization procedures are the main focuses of these enhancements. Other features of.NET9 are covered in my previous writings. For ease of comprehension and…