예제 #1
0
 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."));
     }
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 public List <string> GetIdentifiers() => new List <string>()
 {
     CustomerUID.ToString(),
         AssetUID.ToString()
 };