The Tags Service manages tags used across the system.
It is built using Vertical Slice Architecture with CQRS and a custom in-house Mediator implementation (no external NuGet packages).
The service uses:
- Entity Framework Core
- SQL Server Provider
- Minimal APIs
- DTO-based contracts
- Strict validation rules
- Unique index on Tag Name
Suspended tags are never returned in read endpoints.
- .NET
- Entity Framework Core
- SQL Server
- Minimal APIs
- CQRS (Command / Query separation)
- Custom Shared Kernel Mediator(In Shared Kernal Referenace Project)
- Vertical Slice Architecture
Each feature is isolated in its own folder with:
- Command / Query
- Handler
- DTOs
- Validation
TagsService │ ├── Domain │ └── Tag.cs │ ├── Infrastructure │ └── Persistence │ └── AppDbContext.cs │ ├── SharedKernel │ ├── Mediator │ │ ├── IRequest.cs │ │ ├── IRequestHandler.cs │ │ └── Mediator.cs │ ├── Features │ ├── CreateTag │ ├── GetAllTags │ ├── GetMostRecentTags │ ├── SuspendTag │ └── API └── TagsEndpoints.cs
public class Tag
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime CreatedAt { get; set; }
public int AuthorId { get; set; }
public bool IsSuspended { get; set; }
}
Validation Rules Summary
Tag name must be unique
Tag must exist to be suspended
Suspended tags are excluded from all read endpoints
Search uses indexed Name column for performance
Key Design Notes
No external CQRS or Mediator packages
Vertical Slice keeps features isolated
EF Core used directly
DTOs control API contracts
Clean separation of commands and queries