private static List <FieldDescription> FieldDescriptionsFromType(Type sampleType, string prefix = "") { var descriptions = new List <FieldDescription>(); // Handle A Primitive Type var primitiveType = FieldDescription.GetAlteryxFieldType(sampleType); if (primitiveType != FieldType.E_FT_Unknown) { descriptions.Add( new FieldDescription( "Value", primitiveType, source: $"RoslynInput: {sampleType.Name}") { Description = $"BaseValue: {sampleType.Name}" }); return(descriptions); } // Handle Enumerable Types var iEnumerableType = sampleType.IsInterface && sampleType.GetGenericTypeDefinition() == typeof(IEnumerable <>) ? sampleType.GenericTypeArguments[0] : sampleType.GetInterfaces() .Where( i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable <>)) .Select(i => i.GenericTypeArguments[0]) .FirstOrDefault(); if (iEnumerableType != null) { return(FieldDescriptionsFromType(iEnumerableType)); } // Add All Properties foreach (var propertyInfo in sampleType.GetProperties()) { if (!propertyInfo.CanRead) { continue; } var descriptionType = FieldDescription.GetAlteryxFieldType(propertyInfo.PropertyType); if (descriptionType == FieldType.E_FT_Unknown) { // ToDo: Recurse ... descriptions.AddRange(FieldDescriptionsFromType(propertyInfo.PropertyType, (prefix == "" ? "" : $"{prefix}.") + propertyInfo.Name + ".")); continue; } descriptions.Add( new FieldDescription( prefix + propertyInfo.Name, descriptionType, source: "RoslynInput")); } return(descriptions); }