NHibernate:使用MySql生成C#代码 [英] NHibernate: Generate C# code using MySql

查看:172
本文介绍了NHibernate:使用MySql生成C#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我试图找到一种工具,该工具可生成MySql Db架构的NHibernate中使用的C#类和XML文件.

非常感谢您的帮助.

Hello all!

I am trying to find a tool that generates a C# class and an XML file for using in NHibernate from MySql Db schema.

Any help is greatly appreciated.

推荐答案

DataTable tblSchema = dc.GetDataReader(cmd).GetSchemaTable();
 tblSchema.WriteXml(ConfigurationManager.AppSettings["XMLPath"].ToString() + tableName, true);



这样您可以生成xml,不确定我们如何生成实体类.



This way you can generate xml , Am not sure how can we generate an entity class.


所以我自己找到了一个解决方案.

如果您有类似的问题,请下载并安装 MyGeneration ,然后下载此
So I''ve found a solution by myself.

If you have similar problem, downoad and install MyGeneration, then download this template and push "run" button. All code files will be generated!


这篇关于NHibernate:使用MySql生成C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆