且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

具有类自动生成功能的 .NET ORM 解决方案:Subsonic、Castle AR,...?

更新时间:2023-10-05 14:05:10

关于你不喜欢 SubSonic 的一些想法:

A few thoughts on the things you don't like about SubSonic:

  • 对一对多关系的两端使用 IQueryable 和复数名称 - 这似乎对我来说相当违反直觉;

是的,我同意这是非常反直觉的,我从来没有弄清楚为什么会这样,但是您可以很容易地修改模板来解决这个问题.

True, I agree this is very counter intuitive and I've never got to the bottom of why it is that way, but you can pretty easily modify the templates to fix this.

  • 为所有类生成一个文件——比如每个类有一千行,我对代码文件那么大有一种不好的感觉;

您可能认为这可能会导致问题,但我还没有遇到任何问题,而且我还没有在 *** 上看到一个报告.

You'd think this might cause problems but I've yet to come across any and I've yet to see one reported on ***.

  • T4 处理是自动调用的,因此具有最新架构的数据库必须始终可用.

它仅在您编辑 t4 文件时自动调用,因此实际上您只需要在对模板进行更改时可用的最新架构即可.

It's only invoked automatically if you edit the t4 files so really you only need an up-to-date schema available when you're making changes to the templates.