using FluentValidation; using System.Collections.Generic; namespace Kean.Domain.Basic.Commands { /// /// 修改用户命令 /// public class ModifyUserCommand : CommandValidator, ICommand { /// /// 标识 /// public int Id { get; set; } /// /// 名称 /// public string Name { get; set; } /// /// 账号 /// public string Account { get; set; } /// /// 角色 /// public IEnumerable Role { get; set; } /// /// 验证项 /// protected override void Validation() { RuleFor(r => r.Id).NotEmpty().WithMessage("标识不允许空"); RuleFor(r => r.Name).NotEmpty().WithMessage("名称不允许空"); RuleFor(r => r.Account).NotEmpty().WithMessage("账号不允许空"); } } }