This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I've got an entity called "User". When I generated the database from the model it correctly creates a table called "Users". However, when I execute a simple LINQ query against it: from u in unitOfWork.Users I get a SQL Exception, and the trace log shows the following SQL: SELECT Is this a bug in the nightly build? Robert |
|
|
If I turn off "Pluralized in database" on the model then everything works fine. |
|
|
This occurs because the runtime and design-time settings are out of sync. You have selected Pluralized In Database for round-tripping in the designer, so it is creating a table named Users; but you have not set PluralizeTableNames on the runtime LightSpeedContext, so it is trying to refer to the table as User. Depending on your preferred database convention, either: * In your application, set LightSpeedContext.PluralizeTableNames (you can do this in code or config -- right-click the designer and choose Get Started to see the config entry); or * Switch off pluralisation in the designer. |
|
|
I had created a new database context in code as part of a unit test project, and forgotten to do that. Thanks Ivan! |
|