예제 #1
0
        public static XElement LoadMappingFile(string fileKey)
        {
            MappingFileElement element = MappingFileSection.GetConfig().FileLocations[fileKey];

            ExceptionHelper.TrueThrow(element == null, string.Format("没有与fileKey :{0}匹配的配置信息", fileKey));
            return(LoadMappingFile(element));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 private static string GetFilePath(string modelName)
 {
     return(GetFilePath(MappingFileSection.GetConfig().FileLocations[modelName]));
 }