コード例 #1
0
ファイル: PwdAuthCmd.cs プロジェクト: adwaer/infrastructure
 public static Result <PwdAuthCmd> Create(string password, string email)
 {
     return(ParametersValidation.Validate(
                ParametersValidation.NotNullOrWhiteSpace(password, nameof(password)),
                ParametersValidation.NotNullOrWhiteSpace(email, nameof(email))
                )
            .Combine()
            .Map(() => new PwdAuthCmd(password, email)));
 }
コード例 #2
0
 public static Result <PwdRegistrationCmd> Create(string password, string passwordConfirm, string email)
 {
     return(ParametersValidation.Validate(
                ParametersValidation.NotNullOrWhiteSpace(password, nameof(password)),
                ParametersValidation.Ensure(() => password == passwordConfirm, nameof(passwordConfirm)),
                ParametersValidation.NotNullOrWhiteSpace(email, nameof(email)),
                ParametersValidation.Ensure(() => new EmailAttribute().IsValid(email), nameof(email))
                )
            .Combine()
            .Map(() => new PwdRegistrationCmd(password, email)));
 }