使用 subsonic 3.0 SimpleRepository 到现有数据库 [英] Use subsonic 3.0 SimpleRepository to a existing database
问题描述
我想在我的项目中使用 subsonic 3.0 SimpleRepository,但是有一个问题:
I want to use subsonic 3.0 SimpleRepository in my project, but there is a problem :
如果我的表的名称像 Product 等,那么我无法从数据库中获取任何数据,因为 subsonic 会生成像 "Select * from Products ...
"
If my table's name like Product etc. then I can't get any data from database,
because subsonic generate the sql statement like "Select * from Products ...
"
PS:我不想改变我的表名.
PS: I don't want to change my table name.
我写了一个t4
模板来解决这个问题,希望有人可以看看我的代码并告诉我我做对了吗?
I wrote a t4
template to solve this problem, I hope someone can take a look at my
code and tell me am i do the right thing?
推荐答案
听起来您已经设计了一个数据库,在这种情况下,我建议您改用 LinqTemplates 或 ActiveRecord.SimpleRepository 似乎真的适合代码优先开发过程,而不是数据库优先.
It sounds like you already have a database designed in which case I would suggest you use the LinqTemplates or ActiveRecord instead. SimpleRepository seems to really be suited to a code first development process rather than a database first.
这篇关于使用 subsonic 3.0 SimpleRepository 到现有数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!