コード例 #1
0
        /// <summary>
        /// Generates FetchXMLQueries.
        /// </summary>
        /// <returns>value.</returns>
        public List <string> GetFetchXMLQueries()
        {
            List <string> result = new List <string>();

            if (!string.IsNullOrEmpty(FetchXMLFolderPath))
            {
                var dir   = new DirectoryInfo(FetchXMLFolderPath);
                var files = dir.GetFiles("*.xml");
                foreach (var file in files)
                {
                    result.Add(File.ReadAllText(file.FullName));
                }
            }

            if (CrmMigrationToolSchemaPaths != null && CrmMigrationToolSchemaPaths.Count > 0)
            {
                foreach (var schemaPath in CrmMigrationToolSchemaPaths)
                {
                    CrmSchemaConfiguration schema = CrmSchemaConfiguration.ReadFromFile(schemaPath);
                    result.AddRange(schema.PrepareFetchXMLFromSchema(OnlyActiveRecords, CrmMigrationToolSchemaFilters, GetMappingFetchCreators()));
                }
            }

            return(result);
        }