Search code examples
subsonicsubsonic3

How to use SubSonic SimpleRepository with NON Plural Table Names


I have found out that SubSonic SimpleRepository expectes plural table names however I have started working on a database that doesn't have this and I am unable to change the table names.

Is there a way I can use Subsonic without making database changes?

I have seen one suggestion but I don't fancy that too much.

I'm not tied to using the SimpleRepository I just thought it would be easiest as I need the ability to swap database connections (SQL & Oracle) based on the clients requirements. The schema is the same on both. With SimpleRepository I can just swap out the connection string in the web.config.


Solution

  • You can apply the SubSonicTableNameOverride attribute on your classes you use with Simple Repo and use an arbitrary table name!