public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { if (AssetUID == Guid.Empty || !Guid.TryParse(AssetUID.ToString(), out Guid g)) { yield return(new ValidationResult("Required field values must be valid.")); } }
/// <summary> /// /// </summary> /// <returns></returns> public WorkDefinitionDto ToWorkDefinitionDto() { WorkDefinitionDto dto = new WorkDefinitionDto { AssetUID = AssetUID.ToString(), SwitchNumber = SensorNumber, SwitchWorkStartState = StartIsOn, WorkDefinitionType = WorkDefinitionType }; dto.StartDate = dto.InsertUTC = dto.UpdateUTC = DateTime.UtcNow; return(dto); }
public List <string> GetIdentifiers() => new List <string>() { CustomerUID.ToString(), AssetUID.ToString() };