ASP.NET MVC C# Data Annotations: Compare two values
I am trying to create a data annotation for my MVC model to validate two dates. I have a start date and end date, the end date should be greater than the start date. I have managed to create an annotation but cannot pass values to it. Does ayone have any idea how to do this?
You can compare a DateTime object another object of this type. If the startdate and endate are both DateTime objects the Compare method should do the trick.