-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathAddEditContactCommandValidator.cs
More file actions
30 lines (23 loc) · 1.05 KB
/
AddEditContactCommandValidator.cs
File metadata and controls
30 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//------------------------------------------------------------------------------
// <auto-generated>
// CleanArchitecture.Blazor - MIT Licensed.
// Author: neozhu
// Created/Modified: 2025-03-13
// Validator for AddEditContactCommand: enforces field length and required property rules for Contact entities.
// Docs: https://docs.cleanarchitectureblazor.com/features/contact
// </auto-generated>
//------------------------------------------------------------------------------
// Usage:
// Validates AddEditContactCommand constraints (e.g., maximum field lengths).
namespace CleanArchitecture.Blazor.Application.Features.Contacts.Commands.AddEdit;
public class AddEditContactCommandValidator : AbstractValidator<AddEditContactCommand>
{
public AddEditContactCommandValidator()
{
RuleFor(v => v.Name).MaximumLength(50).NotEmpty();
RuleFor(v => v.Description).MaximumLength(255);
RuleFor(v => v.Email).MaximumLength(255);
RuleFor(v => v.PhoneNumber).MaximumLength(255);
RuleFor(v => v.Country).MaximumLength(255);
}
}