Beispiel #1
0
        internal static string[] GetAllFields(AzDOService service)
        {
            if (allFields == null)
            {
                var fields        = registeredTypes.Value.Values.SelectMany(GetQueryFieldsForType).Distinct().ToArray();
                var definedFields = service.WorkItemClient.GetFieldsAsync().Result.ToList();

#if DEBUG
                foreach (var badField in fields.Where(f => !definedFields.Any(df => df.ReferenceName == f)))
                {
                    service.log.WriteLine(LogLevel.Query, $"Field \"{badField}\" is not defined in AzDO and will be skipped.");
                }
#endif

                allFields = fields.Where(f => definedFields.Any(df => df.ReferenceName == f)).ToArray();
            }

            return(allFields);
        }
Beispiel #2
0
        internal static IEnumerable <string> FilterFields(this IEnumerable <string> fields, AzDOService service)
        {
            var allFields = GetAllFields(service);

            return(fields.Where(f => Array.IndexOf(allFields, f) >= 0));
        }