Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
VarunSaiTeja authored Mar 7, 2021
1 parent a1bebc1 commit f0dbcc7
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,23 @@ Just add the `Validatable` attribute to the class u defined for input.

Ex:
```
[Validatable]
public class AddUserInput
using System.ComponentModel.DataAnnotations;
using Graph.ArgumentValidator;
namespace Demo
{
[Required, MinLength(4, ErrorMessage = "Username must be atleast 4 characters.")]
public string UserName { get; set; }
[Required, RegularExpression(@"^[^@\s]+@[^@\s]+\.[^@\s]+$", ErrorMessage = "Email Id format is invalid")]
public string Email { get; set; }
[Required, RegularExpression(@"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$", ErrorMessage = "Password needs to be more strong.")]
public string Password { get; set; }
[Validatable]
public class AddUserInput
{
[Required, MinLength(4, ErrorMessage = "Username must be atleast 4 characters.")]
public string UserName { get; set; }
[Required, RegularExpression(@"^[^@\s]+@[^@\s]+\.[^@\s]+$", ErrorMessage = "Email Id format is invalid")]
public string Email { get; set; }
[Required, RegularExpression(@"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$", ErrorMessage = "Password needs to be more strong.")]
public string Password { get; set; }
}
}
```

Expand Down

0 comments on commit f0dbcc7

Please sign in to comment.