示例#1
0
        public static void Main(string[] args)
        {
            // String jsonOne = JSON.serialize(objectToSerialize);
            // String jsonOne = JSON.serialize(objectToSerialize, suppressApexObjectNulls)
            List <string>       classNames  = new List <string>();
            ApexClassDb         db          = new ApexClassDb();
            List <ApexClassDto> apexClasses = db.GetApexClassesDb();

            foreach (var apexClass in apexClasses)
            {
                foreach (Method method in apexClass.methods)
                {
                    List <string> parameters = new List <string>();
                    for (int i = 0; i < method.parameters.Length; i++)
                    {
                        method.parameters[i].type = method.parameters[i].type.Replace(',', '.');
                        parameters.Add(method.parameters[i].type);
                    }

                    var allParameters = string.Join(":", parameters);

                    method.returnType = method.returnType.Replace(',', '.');
                    classNames.Add($"{method.returnType},{apexClass.NameSpace},{apexClass.ClassName},{method.name},{allParameters}");
                }
            }

            string apexClassFileLocation = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\"));

            File.WriteAllLines(apexClassFileLocation + @"\Data\SalesForceClasses.csv", classNames);


            //Console.WriteLine("Done, Press Any Key To Exit");
            //Console.ReadLine();
        }
示例#2
0
 public ApexClassDbTest()
 {
     db = new ApexClassDb();
 }