[英]I'm a pretty good C# developer, but I've never done something like this; how would I create a CRUD application generator?
I found SubSonic, but I'd rather roll my own with a few buddies. 我找到了SubSonic,但我希望与几个伙伴一起努力。
I've never done something like this before, but if you tell me technically how I should proceed, I can figure it out. 我以前从未做过这样的事情,但是如果您从技术上告诉我应该如何进行,我可以弄清楚。
I want to have a sort of visual designer. 我想要一个视觉设计师。 Ask the user what tables there are going to be, the relations, what fields, which are primary keys, etc.
询问用户将要有哪些表,关系,哪些字段,哪些是主键等。
Then generate all the appropriate classes with the appropriate DAL and SQL database. 然后使用适当的DAL和SQL数据库生成所有适当的类。
After all is said and done, I'd like to output a simple .exe file with a generic look that allows a user to view all the fields, etc. 说完一切之后,我想输出一个具有通用外观的简单.exe文件,该文件允许用户查看所有字段等。
Any tips, I'm not sure if I should mark this a community wiki or not, because I don't think there is a specific answer. 任何提示,我不确定是否应将其标记为社区Wiki,因为我认为没有特定答案。 Let me know SO.
让我知道。
You could do something similar to what we do (though we generate a domain layer). 您可以执行与我们相似的操作(尽管我们会生成域层)。 Take the MS DSL tools and construct graphical DSL that contains the elements of your DAL (procs, tables, triggers etc).
使用MS DSL工具并构建包含DAL元素(过程,表,触发器等)的图形DSL。 That is not too hard.
那不太难。
Add say drag and drop from the server explorer window to allow reverse engineering of persistence mappings and then write a few T4 templates to generate the code of the DSL model. 从服务器资源管理器窗口添加拖放,以允许对持久性映射进行逆向工程,然后编写一些T4模板以生成DSL模型的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.