动态表和NHibernate问题 [英] Dynamic Table and NHibernate Problem

查看:72
本文介绍了动态表和NHibernate问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个项目,该项目也使动态表单和动态表成为数据库.问题出在使用NHibernate!
由于NHibernate需要映射文件及其内容.
我可以动态地制作这些映射文件,然后进行编译,但这将是混乱的代码.

您有什么建议?

[已删除的电子邮件地址]

Hello guys,

I am developing a project which that makes dynamic forms and dynamic tables DB as well. The problem is using NHibernate!
As NHibernate needs mapping file and its stuff.
I can make those mapping files dynamically and then compile them, but it will be messy code.

What''s your suggestion?

[removed email address]

推荐答案

您已经回答了自己的问题,如果要动态执行此操作并使用NHibernate,则需要动态制作地图文件.

从理论上讲,使用.net实体框架可能会更容易.您可以使用表名和带有列名的属性来修饰类,但这样做也会遇到其他问题,因此,首先研究它是一个好主意.
You have answered your own question, if you want to do this dynamically and use NHibernate you will need to make the map files dynamically.

Theoretically, it might be easier to use the .net entity framework. You can decorate the class with the tablename and properties with column names much more cleanly, but you will face other problems with this too, so it is a good idea to research this first.


这篇关于动态表和NHibernate问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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