/abp-sensei:abp-validationfrom ABP Sensei
Validates DTOs in ABP Framework v10.x using Data Annotations, FluentValidation, IValidatableObject, and AbpValidationException. Use when you need input validation in ABP.
Ships in ABP Sensei. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
User asks about validation, DTO validation, FluentValidation, IValidatableObject, validation errors, AbpValidationException, or input validation in ABP Framework.
ABP provides automatic validation for application service inputs using:
Validation errors are automatically caught and returned as standardized error responses.
public class CreateBookDto
{
[Required]
[StringLength(100)]
public string Name { get; set; }
[Required]
[StringLength(1000)]
public string Description { get; set; }
[Range(0, 999.99)]
public decimal Price { get; set; }
}
Required, StringLength, Range, EmailAddress, RegularExpression, MinLength, MaxLengthpublic class CreateBookDto : IValidatableObject
{
public string Name { get; set; }
public decimal Price { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var results = new List<ValidationResult>();
if (Price <= 0)
{
results.Add(new ValidationResult(
"Price must be greater than zero.",
new[] { nameof(Price) }
));
}
if (string.IsNullOrWhiteSpace(Name))
{
results.Add(new ValidationResult(
"Name cannot be empty.",
new[] { nameof(Name) }
));
}
return results;
}
}
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var myService = validationContext.GetRequiredService<IMyService>();
// Use service for validation logic
// ...
}
Warning: Resolving services in
Validateis possible but not recommended. Keep DTOs simple — they should transfer data, not contain domain validation logic.
abp add-package Volo.Abp.FluentValidation
Or manually:
dotnet add package Volo.Abp.FluentValidation
Add module dependency:
[DependsOn(typeof(AbpFluentValidationModule))]
public class MyModule : AbpModule { }
public class CreateUpdateBookDtoValidator : AbstractValidator<CreateUpdateBookDto>
{
public CreateUpdateBookDtoValidator()
{
RuleFor(x => x.Name).Length(3, 10);
RuleFor(x => x.Price).ExclusiveBetween(0.0f, 999.0f);
RuleFor(x => x.Description).NotEmpty().MaximumLength(1000);
}
}
Enable validation on any DI-registered service:
public class MyService : ITransientDependency, IValidationEnabled
{
public virtual async Task DoItAsync(MyInput input)
{
// input is automatically validated
}
}
Requirements:
virtual OR service used via interfaceITransientDependency, ISingletonDependency, or IScopedDependency)public class MyService : ITransientDependency, IValidationEnabled
{
public bool IsValidationEnabled { get; set; } = true; // Default
public virtual async Task DoItAsync(MyInput input) { }
}
Thrown automatically when validation fails:
public class AbpValidationException : AbpException, IHasValidationErrors
{
public IList<ValidationResult> ValidationErrors { get; }
}
IHasValidationErrors — errors serialized in API response{
"error": {
"code": "App:010046",
"message": "Your request is not valid, please correct and try again!",
"validationErrors": [
{
"message": "Username should be minimum length of 3.",
"members": ["userName"]
},
{
"message": "Password is required",
"members": ["password"]
}
]
}
}
Client Request
↓
DTO Deserialization
↓
ABP Validation Interceptor
↓ (if invalid)
AbpValidationException thrown
↓
ABP Exception Handler
↓
HTTP 400 + validationErrors JSON
↓
Client receives structured error
| Attribute | Purpose | Example |
|---|---|---|
[Required] | Non-null, non-empty | [Required] public string Name { get; set; } |
[StringLength(max)] | Max length | [StringLength(100)] |
[StringLength(min, max)] | Min/max length | [StringLength(3, 100)] |
[Range(min, max)] | Numeric range | [Range(0, 999.99)] |
[EmailAddress] | Email format | [EmailAddress] |
[RegularExpression(pattern)] | Regex match | [RegularExpression(@"^[a-zA-Z]+$")] |
[MinLength(n)] | Minimum collection/string length | [MinLength(3)] |
[MaxLength(n)] | Maximum collection/string length | [MaxLength(100)] |
[Url] | URL format | [Url] |
[Phone] | Phone format | [Phone] |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub burakdmir/abp-skills --plugin abp-sensei26 skills in this plugin
/abp-aiABP Framework v10.x (10.4–10.6) AI integration: Microsoft.Extensions.AI (IChatClient), Semantic Kernel, Microsoft Agent Framework, AI Workspaces, AI Management module (Pro) with RAG, document indexing/chunking and MCP servers. Use when you need chat clients, AI agents, RAG or AI workspace management in ABP./abp-apiABP Framework v10.x (10.4–10.6) API development: Auto API Controllers, dynamic and static C#/JS client proxies, Swagger, API versioning, Integration Services. Use when you need a REST API, controller, dynamic proxy or client generation in ABP./abp-audit-loggingABP Framework v10.x (10.4–10.6) audit logging: AbpAuditingOptions, entity history, IAuditingStore, audit log storage and filtering. Use when configuring audit trails, audit logs, or entity history in ABP./abp-authorizationABP Framework v10.x (10.4–10.6) authorization: defining permissions (PermissionDefinitionProvider), [Authorize], CheckPolicyAsync/IsGrantedAsync, CurrentUser, IPermissionManager, resource-based auth, multi-tenancy permissions. Use when you need permission, role or access checks in ABP./abp-cliABP Framework v10.x (10.4–10.6) CLI and tooling: abp new, add-package, generate-proxy, ABP Studio, ABP Suite, --modern flag. Use when working with ABP CLI commands, creating projects, adding packages, or generating proxies./abp-daprABP Framework v10.x (10.4–10.6) Dapr integration: Volo.Abp.Dapr packages, service invocation via C# API client proxies (Volo.Abp.Http.Client.Dapr), distributed event bus over Dapr pub/sub (Volo.Abp.EventBus.Dapr + Volo.Abp.AspNetCore.Mvc.Dapr.EventBus), distributed lock, AbpDaprOptions, API token security. Use when you need Dapr sidecar communication, Dapr pub/sub, or Dapr service invocation in ABP.Other plugins' skills for the same job