hassanhabib / The-Standard

This is The Standard. A collection of decades of experience in the engineering industry. I authored it to help you navigate the vast ocean of knowledge. The Standard is not perfect and never will be, and it reflects the ongoing evolution of the engineering industry. While one person may write it, it is the collection of thoughts from hundreds of engineers I've had the honor to interact with and learn from throughout my life.
1.09k stars 208 forks source link

CODE RUB: Change UpsertData() method to UpsertDataList() #278

Closed YaqubAliy02 closed 3 months ago

YaqubAliy02 commented 5 months ago

private void Validate(params (dynamic Rule, string Parameter)[] validations) { var invalidStudentException = new InvalidStudentException( message: "Student is invalid. Please fix the errors and try again.");

foreach((dynamic rule, string parameter) in validations)
{
    if(rule.Condition)
    {
        invalidStudentException.UpsertData(parameter, rule.Message);
    }
}

invalidStudentException.ThrowIfContainsErrors();

}

glhays commented 3 months ago

@YaqubAliy02 Good eye catching this. Are you going to resolve this with a pull request.