Creating Dynamic Flowcharts and Architecture Diagrams

Microsoft Visio Visio is Microsoft’s diagramming tool. It is very powerful, but it is paid, and it only runs on Windows, with no support for Mac or Linux. Although Microsoft has released Visio Online, its features are still fairly limited, and it is also paid. The Open-Source Drawio Tool Drawio is an open-source diagramming tool. It supports both online and desktop use, multiple formats, multiple platforms, multiple languages, many kinds of shapes, many export formats, many plugins, and many integration options. It also supports diagramming in Visual Studio Code via a plugin. ...

March 10, 2026

Database Object Naming Conventions

Different database objects follow different naming conventions. To accommodate different databases, EF Core provides several naming convention configuration options. Common Naming Styles Naming policy Original Converted PascalCase HelloShop HelloShop CamelCase HelloShop helloShop SnakeCaseLower HelloShop hello_shop SnakeCaseUpper HelloShop HELLO_SHOP KebabCaseLower HelloShop hello-shop KebabCaseUpper HelloShop HELLO-SHOP You can use the Humanizr library to convert strings between different naming styles. Singular or Plural Table Names By default, EF Core uses the singular form for table names. You can use a convention-based configurator or manually specify plural table names. The community debate over singular versus plural table names has always existed and there is no unified standard, but Zero recommends the singular form. ...

March 10, 2026

Designing Permission Definitions and Permission Providers

Permission Definitions Each microservice is autonomous, and permission definitions are also the responsibility of each microservice. They each define their own permissions. The permission manager will automatically merge permission definitions. The permission definition context is a collection of permission definitions within the microservice and global permission definitions. The permission provider will provide permission data based on the permission definition context. Permission grouping is to facilitate the management of permission definitions. Permission grouping is part of the permission definition. The permission provider is automatically injected into the container to provide permission query endpoints. ...

March 10, 2026

Gateway and Service Discovery

Building and Designing an API Gateway An API gateway is a server that acts as an intermediary between clients and backend services. It receives requests from clients and forwards them to the backend services. An API gateway can also perform other tasks, such as authentication, monitoring, load balancing, caching, request analysis, and logging. The BFF Pattern for Aggregating Multiple Services An API gateway can aggregate multiple services based on the BFF (Backend for Frontend) pattern. When a client requests data, the API gateway can call multiple services to fetch the data and then aggregate it into a single response returned to the client, reducing the number of round trips between the client and backend services and thereby improving performance. ...

March 10, 2026

Generating API Documentation with the OpenAPI Specification

Swagger is a language-agnostic specification for describing REST APIs. It lets computers and users understand what a REST API does without directly accessing the source code. The Swagger project was donated to the OpenAPI Initiative, and since then it has been known as the OpenAPI Specification. Swashbuckle is an open-source project for .NET Core. It is a collection of OpenAPI tools used to generate OpenAPI specification documents. It can generate API documentation automatically, including API descriptions, request and response formats, parameter descriptions, and more. ...

March 10, 2026

Getting the Time with TimeProvider

Getting the Time the Traditional Way We usually use DateTime.Now and DateTimeOffset.Now to get the current time, but code written this way is hard to test: the time depends on the system clock, which is difficult to control and reproduce — the only way to change it is to change the system time. var now1 = DateTime.Now; var nowUtc1 = DateTime.UtcNow; var now2 = DateTimeOffset.Now; var nowUtc2 = DateTimeOffset.UtcNow; The New TimeProvider Type To solve the problems above, .NET 8 introduced the TimeProvider type, which can be used to get the time and makes it easy to control the time in tests. ...

March 10, 2026

Globalization and Localization

Globalization means a web application can adapt to different cultures and regions without code changes. Localization means a web application can display different content based on the user’s culture and region. Globalization and localization are two different concepts, but they are often used together. There are many ways to implement multiple languages: resource files, databases, configuration files, and so on. This article focuses on the resource file approach, which is also what Microsoft officially recommends. Other options such as PO files and JSON files can also achieve multilingual support, but they are less convenient than resource files. ...

March 10, 2026

Identity System and Identity API Endpoints

ASP.NET Core Identity architecture ASP.NET Core Identity is a mature identity system that provides user management, role management, claim management, password management, sign-in management, external login management, two-factor authentication, email confirmation, phone number confirmation, security token management, user lockout, user unlock, user sign-out, user deletion, user recovery, and more. Identity architecture explained Entity type Description User Represents a user. Role Represents a role. UserClaim Represents a claim that a user possesses. UserToken Represents an authentication token for a user. UserLogin Associates a user with a login. RoleClaim Represents a claim granted to all users within a role. UserRole A join entity that links users and roles. Storing Identity data with EF Core Defining entity types public class User : IdentityUser<int> { public DateTimeOffset CreationTime { get; set; } = DateTimeOffset.UtcNow; } public class Role : IdentityRole<int> { public DateTimeOffset CreationTime { get; set; } = DateTimeOffset.UtcNow; } Configuring entity types public class UserEntityTypeConfiguration : IEntityTypeConfiguration<User> { public void Configure(EntityTypeBuilder<User> builder) { builder.ToTable("Users"); builder.HasKey(x => x.Id); builder.Property(x => x.CreationTime); } } Reusing the Identity database context dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore public class IdentityServiceDbContext(DbContextOptions<IdentityServiceDbContext> options) : IdentityDbContext<User, Role, int>(options) { protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly()); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } } Using the Identity API endpoints builder.Services.AddIdentityApiEndpoints<User>(options => { options.Password.RequireDigit = false; options.Password.RequireLowercase = false; options.Password.RequireUppercase = false; options.Password.RequireNonAlphanumeric = false; options.Password.RequiredLength = 5; options.SignIn.RequireConfirmedAccount = false; }).AddEntityFrameworkStores<IdentityServiceDbContext>(); app.MapGroup("identity").MapIdentityApi<User>(); Working with Identity data Services such as UserManager, RoleManager, SignInManager, and PasswordValidator can all be used to work with Identity data. Unless there is a special case, it is not recommended to manipulate Identity data directly with a DbContext. ...

March 10, 2026

Implementing a Distributed Event Bus with Dapr

Abstracting the Distributed Bus Using design patterns, the way a distributed bus is used is abstracted, defining the basic capabilities of the bus. Event Bus-Based Components The distributed event bus is implemented in a componentized way, encapsulating the implementation details of the bus inside components. RabbitMQ-based implementation: https://github.com/dotnet/eShop/tree/main/src/EventBusRabbitMQ The Dapr Implementation of the Event Bus Dapr is an open-source distributed application runtime. Its publish and subscribe module enables microservices to communicate with each other using event-driven architecture messaging. Dapr provides an implementation of the event bus: publish events via Dapr, expose Dapr subscription endpoints, and route messages to different event handlers. ...

March 10, 2026

Implementing the Basket Service with gRPC

What Is the gRPC Communication Framework gRPC is a high-performance, open source, general-purpose RPC framework developed by Google. It is based on HTTP/2 and supports multiple languages (such as Go, Java, Python, C++, Node.js, Ruby, C#, Objective-C, PHP, and Dart). gRPC uses Protocol Buffers as its interface definition language (IDL). Protocol Buffers is a lightweight and efficient structured data serialization method, similar to XML or JSON, but smaller, faster, and simpler. ...

March 10, 2026