public static XElement LoadMappingFile(string fileKey) { MappingFileElement element = MappingFileSection.GetConfig().FileLocations[fileKey]; ExceptionHelper.TrueThrow(element == null, string.Format("没有与fileKey :{0}匹配的配置信息", fileKey)); return(LoadMappingFile(element)); }
private static string GetBaseDir() { string baseDir = MappingFileSection.GetConfig().BaseDir; ExceptionHelper.TrueThrow(string.IsNullOrWhiteSpace(baseDir), string.Format("配置信息baseDir不能为空")); ExceptionHelper.FalseThrow(Directory.Exists(baseDir), string.Format("未找到baseDir:{0}对应的目录", baseDir)); return(baseDir); }
public static List <XElement> LoadMappingFile() { List <XElement> result = new List <XElement>(); string baseDir = GetBaseDir(); MappingFileElementCollection collection = MappingFileSection.GetConfig().FileLocations; foreach (MappingFileElement element in collection) { result.Add(LoadMappingFile(element)); } return(result); }
private static string GetFilePath(string modelName) { return(GetFilePath(MappingFileSection.GetConfig().FileLocations[modelName])); }