public override string GetCacheKey() { return(string.Format("BodyExerciseCriteria_{0}_{1}_{2}_{3}_{4}", Id == null ? "null" : Id.GetCacheKey(), Name == null ? "null" : Name.GetCacheKey(), MuscleId == null ? "null" : MuscleId.GetCacheKey(), ExerciseCategoryType == null ? "null" : ExerciseCategoryType.GetCacheKey(), ExerciseUnitType == null ? "null" : ExerciseUnitType.GetCacheKey())); }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { var results = new List <ValidationResult>(); if (ExerciseId.IsNot24BitHex()) { results.Add(new ValidationResult($"{nameof(ExerciseId)} must be a valid 24-bit hex string.", new[] { nameof(ExerciseId) })); } if (MuscleId.IsNot24BitHex()) { results.Add(new ValidationResult($"{nameof(MuscleId)} must be a valid 24-bit hex string.", new[] { nameof(MuscleId) })); } return(results); }