Ejemplo n.º 1
0
        /// <summary>
        /// 生成实体代码
        /// </summary>
        /// <param name="project"></param>
        /// <param name="schema"></param>
        public override void CreateEntityCode(ProjectConfig project, EntityConfig schema)
        {
            if (schema.NoDataBase)
            {
                return;
            }
            var entityPath = project.GetModelPath("Entity");

            Message = entityPath;
            CreateCode <EntityBuilder>(project, schema, project.GetModelPath("Entity", "Model"));

            CreateCode <EntityValidateBuilder>(project, schema, entityPath);

            var accessPath = project.GetModelPath("DataAccess", "DataAccess");

            Message = accessPath;

            if (project.DbType == DataBaseType.MySql)
            {
                CreateCode <MySqlAccessBuilder>(project, schema, accessPath);
            }
            else
            {
                CreateCode <SqlServerAccessBuilder>(project, schema, accessPath);
            }
            var blPath = project.GetModelPath("Business");

            CreateCode <BusinessBuilder>(project, schema, blPath);
            Message = blPath;
        }