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