This project is read-only.

ValidateMinValue

Description: Indicates a property has a minimum value.

Constructor(s):
  • public ValidateMinValueAttribute(double minValue, string message)

Parameters:
  • minValue: The minimum value of the property.
  • message: The message to be used if validation fails.

Example Usage:
public class MyEntity : EvilBaseEntity
{
    [ValidateMinValue(100, "Property1 is has a minimum value of 100.")]
    public double Property1
    {
        // Omitted for brevity
    }
}


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

bool result = entity.IsValid();


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

bool result = entity.IsValid();


Invalid Entity:
MyEntity entity = new MyEntity();
entity.Property1 = 99.99999;

bool result = entity.IsValid();

Last edited Dec 7, 2006 at 3:50 PM by Arcware, version 1

Comments

No comments yet.