开发者

Subsonic 3 SimpleRepository NON Plural Table names?

Is it possible to use SubSonic 3's Simple Repository with non-plural table names? My DB already exists,开发者_如何学运维 the table names a re singular add I cannot change them.


Nope, it is hardcoded in the SubSonic's source. You can pull it down and trace the migration steps to see where the plural happens. I know, cause I wanted the same thing.

I was tinkering with modifying the source to make plurals optional via some parameter/config override or alike. But, I didn't get it completed (yet).


If your tables already exist then this is not the intended use of the Simple Repository model. The simple repository model is designed to generate the table structures for you using migrations.

If you are using a database that already exists then you would be better served using the T4 Templates as they also support the relationships between your tables.

Cheers,

Ed


With Subsonic 3.0.0.4 in the settings.ttinclude I removed the line;

AddSingularRule("s$", String.Empty);

which was down about 260 lines in the Inflector rules class. Didn't need to mess around with the subsonic source code.

HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜