/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (HostPlatform == null) { throw new ValidationException(ValidationRules.CannotBeNull, "HostPlatform"); } if (IoTDeviceDetails == null) { throw new ValidationException(ValidationRules.CannotBeNull, "IoTDeviceDetails"); } if (IoTEdgeDeviceDetails == null) { throw new ValidationException(ValidationRules.CannotBeNull, "IoTEdgeDeviceDetails"); } if (RoleStatus == null) { throw new ValidationException(ValidationRules.CannotBeNull, "RoleStatus"); } if (IoTDeviceDetails != null) { IoTDeviceDetails.Validate(); } if (IoTEdgeDeviceDetails != null) { IoTEdgeDeviceDetails.Validate(); } if (ShareMappings != null) { foreach (var element in ShareMappings) { if (element != null) { element.Validate(); } } } if (IoTEdgeAgentInfo != null) { IoTEdgeAgentInfo.Validate(); } if (ComputeResource != null) { ComputeResource.Validate(); } }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (IoTDeviceDetails == null) { throw new ValidationException(ValidationRules.CannotBeNull, "IoTDeviceDetails"); } if (IoTEdgeDeviceDetails == null) { throw new ValidationException(ValidationRules.CannotBeNull, "IoTEdgeDeviceDetails"); } if (IoTDeviceDetails != null) { IoTDeviceDetails.Validate(); } if (IoTEdgeDeviceDetails != null) { IoTEdgeDeviceDetails.Validate(); } }