/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Id == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } if (Device == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Device"); } if (Os == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Os"); } if (Browser == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Browser"); } if (Language == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Language"); } if (Device != null) { Device.Validate(); } if (Os != null) { Os.Validate(); } if (Browser != null) { Browser.Validate(); } }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Version == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Version"); } if (Id == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } if (Device == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Device"); } if (Os == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Os"); } if (Browser == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Browser"); } if (Language == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Language"); } if (Resolution == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Resolution"); } if (Fonts == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Fonts"); } if (Plugins == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Plugins"); } if (Device != null) { Device.Validate(); } if (Os != null) { Os.Validate(); } if (Browser != null) { Browser.Validate(); } }