private static void AddActionImports(ImportManager imports, MvcAction action)
 {
     imports.TryAddToImports(action.ReturnType);
     foreach (var param in action.ActionParameters)
     {
         foreach (var type in param.Types)
         {
             imports.TryAddToImports(type);
         }
     }
 }
        public static ImportManager FromTypes(IEnumerable <ExtractedType> types, string outputPath)
        {
            ImportManager newManager = new ImportManager(outputPath);

            foreach (var type in types.GetReferenceTypes())
            {
                // Check the base type of the type
                if (type.BaseType != null)
                {
                    newManager.TryAddToImports(type.BaseType);
                }

                // Check each property type
                foreach (var property in type.Properties)
                {
                    newManager.TryAddToImports(property.Type);
                }
            }

            return(newManager);
        }