Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
189 views
in Technique[技术] by (71.8m points)

c# - NHibernate Code Generation

I am working with NHibernate, and a few code generation tools. MyGeneration is one and SmartCode is the other.

This question has been asked before, but I have looked at some other responses and found that the code generation tools in the nHibernate space to be pretty poor.

I might be able to get away with MyGeneration and SmartCode, but are there any other possibilities out there that you have specifically used, and would recommend?

I guess my criteria is that they must work with MSSQL 2008, and tools that are currently being developed would be good too as it seems that some of the tools are not being actively developed any more.

Also the tools would ideally generate the domain objects, and also the nhibernate mapping files - Fluent nhibernate would be good but not essential. It would be good if the templates and method of code generation could be tweaked.

I am a developer so am happy to get my hands dirty on the right tool to make changes.

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I strongly recommend you take a look at Visual NHibernate alt text from Slyce. I have used all tools out there both free and commercial and found it to be the only one that does exactly what it says on the can and more.

It allows you to design your entities either from the ground up or from an existing database. alt text
(source: slyce.com)

It is compatible with most existing dbs

alt text

with future suport for Postgresql.

It allows you to customise your entities to your specs alt text
(source: slyce.com)

Other than its ability to go back and forth smoothly between entities and db during design, my most favorate feature is the Diff View

alt text
(source: slyce.com)

which shows changes it will make to code before it generates the code. So not only can you see the effect of your changes but you can also cancel the codegeneration in time or simply output to a different folder.

This tool has many many fine features and is now mature. Lastly, there is a 30% discount going on so ;-)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...