public CreateTaskValidator() { RuleFor(createTask => createTask.title).NotNull().NotEmpty().WithMessage("Backlog标题不能为空"); RuleFor(createTask => createTask.backLogID).Must(s => s > 0).WithMessage("所属backlog不能为空"); RuleFor(createTask => createTask.assignedEmail).NotNull().WithMessage("负责人邮箱不能为空") .EmailAddress().WithMessage("负责人邮箱格式不正确").EmailAddress().WithMessage("负责人邮箱格式不正确");; RuleFor(createTask => createTask.state).Must(s => TaskState.CheckState(s)).WithMessage("状态编号不正确"); }
public ModifyTaskValidator() { RuleFor(modifyTask => modifyTask.state).Must(s => TaskState.CheckState(s)).WithMessage("状态编号不正确"); }