public List <Sobject> GetAllObjects() { string objectListPath = Path.Combine(ApexSharp.GetSession().VsProjectLocation, "objectList.json"); HttpManager httpManager = new HttpManager(); var requestJson = httpManager.Get("sobjects/"); File.WriteAllText(objectListPath, requestJson); var json = File.ReadAllText(objectListPath); SObjectDescribe sObjectList = JsonConvert.DeserializeObject <SObjectDescribe>(json); return(sObjectList.sobjects.ToList()); }
public List <string> GetAllObjectNames() { List <string> objectList = new List <string>(); HttpManager httpManager = new HttpManager(); var requestJson = httpManager.Get($"sobjects/"); var cacheLocation = Path.Combine(ConnectionUtil.GetSession().VsProjectLocation, "Cache"); File.WriteAllText(cacheLocation + "/objectList.json", requestJson); var json = File.ReadAllText(cacheLocation + "/objectList.json"); SObjectDescribe sObjectList = JsonConvert.DeserializeObject <SObjectDescribe>(json); foreach (var sobject in sObjectList.sobjects) { objectList.Add(sobject.name); } return(objectList); }
public List <Sobject> GetAllObjects() { string dirPath = ConnectionUtil.GetSession().VsProjectLocation; HttpManager httpManager = new HttpManager(); var requestJson = httpManager.Get($"sobjects/"); File.WriteAllText(dirPath + @"\objectList.json", requestJson); var json = File.ReadAllText(dirPath + @"\objectList.json"); SObjectDescribe sObjectList = JsonConvert.DeserializeObject <SObjectDescribe>(json); return(sObjectList.sobjects.ToList()); //var customObjectCount = allSobjects.Where(x => x.custom).ToList(); //var customSetting = allSobjects.Where(x => x.customSetting).ToList(); //var objectCount = allSobjects.Where(x => x.custom == false && x.customSetting == false).ToList(); //System.Console.WriteLine(customObjectCount.Count()); //System.Console.WriteLine(customSetting.Count()); //System.Console.WriteLine(objectCount.Count()); }