private void AddAllSpecies(AppRoot appRoot) { using (var docSession = CreateSession()) { appRoot.SetPerformSpeciesDataUpdate(false); docSession.Store(appRoot); docSession.SaveChanges(); } var fileList = Directory.GetFiles(Path.Combine(_configSettings.GetEnvironmentRootPath(), _configSettings.GetSpeciesRelativePath())); foreach (var file in fileList.Where(x => !Path.GetFileName(x).StartsWith("UTF8-"))) { AddSpeciesKingdom(file); } }
// There is some weirdness in Path.Combine, in that if a path contains an absolute path, only that path is returned.. // http://stackoverflow.com/questions/53102/why-does-path-combine-not-properly-concatenate-filenames-that-start-with-path-di public string MakeMediaBasePath(string mediaResourceId) { var relativePath = Path.Combine( _configSettings.GetMediaRelativePath(), GetDirectoryName(mediaResourceId)); return(string.Format( "{0}{1}", _configSettings.GetEnvironmentRootPath(), relativePath)); }