This project is read-only.

ValidateWholeNumber

Description: Indicates a property must be a whole number.

Constructor(s):
  • public ValidateWholeNumberAttribute(string message)

Parameters:
  • message: The message to be used if validation fails.

Example Usage:
public class MyEntity : EvilBaseEntity
{
    [ValidateWholeNumber("Property1 must be a whole number.")]
    public long Property1
    {
        // Omitted for brevity
    }

    [ValidateWholeNumber("Property2 must be a whole number.")]
    public decimal Property2
    {
        // Omitted for brevity
    }
}


Valid Entity:
MyEntity entity = new MyEntity();
entity.Property1 = 100;

bool result = entity.IsValid();


Invalid Entity:
MyEntity entity = new MyEntity();
entity.Property2 = 100.54M;

bool result = entity.IsValid();

Last edited Dec 7, 2006 at 4:55 PM by Arcware, version 1

Comments

No comments yet.