예제 #1
0
        /// <summary>
        /// 输出代码文件
        /// </summary>
        internal async Task WriteFile(IT4Template template, GrpcBuildConfig conf)
        {
            using (var writer = new CodeWriter(FilePath))
            {
                template.Session = new Dictionary <string, object>
                {
                    ["config"] = conf,
                    ["file"]   = this
                };
                template.Initialize();

                await writer.WriteAsync(template.TransformText());
            }

            /*writer.WriteLine(UsingSection);
             *  //writer.WriteLine("namespace {0}", NameSpace);
             *  writer.BeginSubWrite();
             *  foreach (var dotNetType in TypeList)
             *  {
             *      dotNetType.RenderCode(writer);
             *  }
             *  writer.EndSubWrite();
             *  writer.Flush();*/
        }
예제 #2
0
 public GrpcServiceBuilder(GrpcBuildConfig conf)
 {
     Config = conf;
 }