-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathUpdateContactCommandValidator.cs
More file actions
32 lines (25 loc) · 1.17 KB
/
UpdateContactCommandValidator.cs
File metadata and controls
32 lines (25 loc) · 1.17 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
30
31
//------------------------------------------------------------------------------
// <auto-generated>
// CleanArchitecture.Blazor - MIT Licensed.
// Author: neozhu
// Created/Modified: 2025-03-19
// Validator for UpdateContactCommand: ensures required fields (e.g., Id, non-empty Name, max length for properties) are valid for updating a contact.
// Docs: https://docs.cleanarchitectureblazor.com/features/contact
// </auto-generated>
//------------------------------------------------------------------------------
//
// Usage:
// Validates UpdateContactCommand to ensure complete and valid data before processing the update.
namespace CleanArchitecture.Blazor.Application.Features.Contacts.Commands.Update;
public class UpdateContactCommandValidator : AbstractValidator<UpdateContactCommand>
{
public UpdateContactCommandValidator()
{
RuleFor(v => v.Id).NotNull();
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);
}
}