Blame view

netcore/src/Infrastructure/NCC/ViewEngine/Internal/Penetrates.cs 834 Bytes
de2bd2f9   “wangming”   项目初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  using System;
  using System.IO;
  
  namespace NCC.ViewEngine
  {
      /// <summary>
      /// 常量、公共方法配置类
      /// </summary>
      internal static class Penetrates
      {
          /// <summary>
          /// 获取模板文件名
          /// </summary>
          /// <param name="fileName"></param>
          /// <returns></returns>
          internal static string GetTemplateFileName(string fileName)
          {
              var templateSaveDir = Path.Combine(AppContext.BaseDirectory, "templates");
              if (!Directory.Exists(templateSaveDir)) Directory.CreateDirectory(templateSaveDir);
  
              if (!fileName.EndsWith(".dll", System.StringComparison.OrdinalIgnoreCase)) fileName += ".dll";
              var templatePath = Path.Combine(templateSaveDir, "~" + fileName);
  
              return templatePath;
          }
      }
  }