Last active
April 17, 2021 22:13
-
-
Save davidelettieri/05924714163a02cfb7598be9634231c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Union<Customer,Failure> ValidateEmail(Customer c) { | |
if(c.Email is null) | |
return new Failure("Email is not valid"); | |
return c; | |
} | |
Union<Customer,Failure> ValidateNameSurname(Customer c) { | |
if(c.Name is null) | |
return new Failure("Name is not valid"); | |
if(c.Surname is null) | |
return new Failure("Surname is not valid"); | |
return c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment