public async Task Validate(IValidationContext context, WorkItem workItem) { var type = (string)workItem.Fields[FieldNames.WorkItemType]; // if we haven't processed this type at all if (!context.ValidatedTypes.Contains(type) && !context.SkippedTypes.Contains(type)) { ClientHelpers.ExecuteOnlyOnce(type, () => { // just because we got the ownership of the mutex, it doesn't mean the // type hasn't been validated. if (!context.ValidatedTypes.Contains(type) && !context.SkippedTypes.Contains(type)) { ValidateWorkItemTypeFidelity(context, type); } }); } // Nothing we can do with a work item type that doesn't exist, add it to the skipped list. if (context.SkippedTypes.Contains(type)) { context.SkippedWorkItems.Add(workItem.Id.Value); } }