CodeGen/Builders/CodeBuilder.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ComLib;
using ComLib.Models;


namespace ComLib.CodeGeneration
{
    /// <summary>
    /// This class provides methods that call 
    /// all the builders relevant to code generation.
    /// </summary>
    public class CodeBuilder
    {
        //private ModelContext _context;

        
        /// <summary>
        /// Process.
        /// </summary>
        /// <param name="ctx">The model context containing all the models.</param>
        /// <returns></returns>
        public static BoolMessageItem<ModelContainer> Process(ModelContext ctx)
        {
            IList<ICodeBuilder> builders = new List<ICodeBuilder>()
            {
                new CodeBuilderDb(ctx.AllModels.Settings.Connection),
                new CodeBuilderDomain()
            };
            return Process(ctx, builders);
        }


        /// <summary>
        /// Process.
        /// </summary>
        /// <param name="ctx">The model context containing all the models.</param>
        /// <param name="builders">The builders.</param>
        /// <returns></returns>
        public static BoolMessageItem<ModelContainer> Process(ModelContext ctx, IList<ICodeBuilder> builders)
        {
            foreach (ICodeBuilder builder in builders)
            {
                builder.Process(ctx);
            }
            return new BoolMessageItem<ModelContainer>(null, false, string.Empty);
        }


        /// <summary>
        /// Process.
        /// </summary>
        /// <param name="ctx">The model context containing all the models.</param>
        /// <param name="populator">The populator.</param>
        /// <param name="modelsToInclude">The names of the models to process. This is used a include filter.</param>
        /// <returns></returns>
        public static BoolMessageItem<ModelContainer> Process(ModelContext ctx, Action<IList<ICodeBuilder>> populator, IDictionary<string, string> modelsToInclude)
后面还有 82 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。