Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active December 12, 2015 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save einarwh/4761670 to your computer and use it in GitHub Desktop.
Save einarwh/4761670 to your computer and use it in GitHub Desktop.
The same example using simplified syntax.
public class Person
{
[Mkay("< (len .) 5", ErrorMessage = "That's too long, my friend.")]
public string Name { get; set; }
[Mkay(">= \"31.01.1900\"")]
public DateTime BirthDate { get; set; }
[Mkay("<= (now)")]
public DateTime DeathDate { get; set; }
[Mkay("and (>= BirthDate) (<= DeathDate)")]
public DateTime LastSeen { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment