Search code examples
linqlinq-to-sqllinqpad

LinqPad adds an S to the end of every table


I have just downloaded LinqPad to explore the benefits of using Linq queries in an application I am working on, however when I look at my database tables in the column on the left LinqPad displays all my tables with an 's' on the end, for instance CategoryTbl becomes CategoryTbls yet when I view my database in SQL management studio the table names appear correct.

Though any tables that should have an S on the end ie clients remain unchanged.

When I execute a Linq query I have to execute it against CategoryTbls but a SQL query has to be executed against CategoryTbl.

I was just wondering why this has happened, is it a bug or a feature? and if it is a feature why?

Thanks


Solution

  • The first question from the LINQPad FAQ:

    Why does LINQPad pluralize table and child association properties? Can I switch this off?

    Pluralizing child association properties (while keeping parent associations singular) makes for the most natural queries and is what Visual Studio does by default in building typed DataContexts.

    To switch off pluralization, uncheck the "Pluralize" option when adding the database connection. (If the connection has already been created, right-click it to edit the connection properties).