private static void GetAllDependencies(ResourceType resourceType, HashSet <ResourceType> dependencies)
 {
     foreach (ResourceProperty property in resourceType.Properties)
     {
         ResourceType itemType = null;
         if (property.ResourceType.ResourceTypeKind != ResourceTypeKind.ComplexType)
         {
             if (property.ResourceType.ResourceTypeKind == ResourceTypeKind.Collection)
             {
                 CollectionResourceType collectionResourceType = property.ResourceType as CollectionResourceType;
                 if (collectionResourceType.ItemType.ResourceTypeKind != ResourceTypeKind.Primitive)
                 {
                     itemType = collectionResourceType.ItemType;
                 }
             }
         }
         else
         {
             itemType = property.ResourceType;
         }
         if (itemType == null || dependencies.Any <ResourceType>((ResourceType item) => item.FullName == itemType.FullName))
         {
             continue;
         }
         dependencies.Add(itemType);
         ResourceTypeExtensions.GetAllDependencies(itemType, dependencies);
     }
 }
        public static HashSet <ResourceType> GetAllDependencies(this ResourceType resourceType)
        {
            HashSet <ResourceType> resourceTypes = new HashSet <ResourceType>();

            ResourceTypeExtensions.GetAllDependencies(resourceType, resourceTypes);
            return(resourceTypes);
        }