public List <string> GetActionsList(string connectionstring) { var client = Connection.CrmConnection.GetClientByConnectionString(connectionstring); var metadata = new Utility.XrmMetaData(client); return(metadata.GetActions()); }
public void GenerateActionsMetaDataStruct(string connectionstring, string filepath) { var client = Connection.CrmConnection.GetClientByConnectionString(connectionstring); var metadata = new Utility.XrmMetaData(client); var actions = metadata.GetActions(); //string filePath = new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath; //var outpath = Path.GetFullPath($"{System.IO.Path.GetDirectoryName(filePath)}\\{filepath}"); var outpath = GetPath(filepath); using (System.IO.StreamWriter file = new System.IO.StreamWriter(outpath)) { file.WriteLine("public struct XrmActions"); file.WriteLine("{"); foreach (var x in actions) { file.WriteLine($"\tpublic static readonly string {x} = \"{x}\";"); } file.WriteLine("}"); } Log($"Struct generated to {outpath}"); }