Slee
Slee

Reputation: 28248

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.

Upvotes: 1

Views: 313

Answers (3)

Ian Quigley
Ian Quigley

Reputation: 510

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

Upvotes: 0

Ed Bishop
Ed Bishop

Reputation: 790

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

Upvotes: 0

eduncan911
eduncan911

Reputation: 17604

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).

Upvotes: 1

Related Questions