Пример #1
0
        /// <summary>
        /// 输出成GeneratorEntity
        /// </summary>
        /// <param name="classModelInfo"></param>
        /// <returns></returns>
        public Buffalo.GeneratorInfo.EntityInfo ToGeneratorEntity(UIModelItem classModelInfo)
        {
            List <Property> lst = new List <Property>(_lstProperty.Count);

            foreach (UIModelItem item in _lstProperty)
            {
                lst.Add(item.ToGeneratItem());
            }

            string dbName = DBConfigInfo.GetDbName(DesignerInfo);

            Buffalo.GeneratorInfo.EntityInfo entity = new Buffalo.GeneratorInfo.EntityInfo(dbName, _fileName,
                                                                                           _namespace, _className, _summary, _baseTypeName, lst,
                                                                                           _dicGenericInfo, classModelInfo.ToGeneratItem());
            return(entity);
        }
Пример #2
0
        /// <summary>
        /// 运行编译函数并返回结果
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public string Invoke(EntityInfo entityInfo, UIConfigItem classConfig,
                             List <UIModelItem> selectPropertys, UIModelItem classInfo)
        {
            Buffalo.GeneratorInfo.EntityInfo entity = entityInfo.ToGeneratorEntity(classInfo);
            List <Property> lst = new List <Property>(selectPropertys.Count);

            foreach (UIModelItem item in selectPropertys)
            {
                lst.Add(item.ToGeneratItem());
            }
            try
            {
                string ret = _methodInfo.Invoke(_codeClass, new object[] { entity, lst }) as string;
                return(ret);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }