2

When running the application and querying the entity with linq I get

System.Data.SqlClient.SqlException: Invalid object name 'dbo.UsersAssessmentsDevelopmentalActivities1'.

I've checked the dbContext model and the entity UserAssessmentDevelopmentalActivity against the database to make sure they were both in sync as far as naming and field properties.

I know EF can do so odd things when pluralizing...but everything looks correct?

Any suggestions

Thanks in advance

FLICKER
  • 6,439
  • 4
  • 45
  • 75
jamesT
  • 113
  • 8
  • More information on the code base would be welcome, like a code example of your (POCO?) entity class, mapping class if you have one? Which version of EF do you use? Which way do you use EF? Code First, Db First...? If you are running EF/CF then add an explicit mapping to your table name in your entity mapping constructor method with the extension method this.ToTable("UserAssessmentDevelopmentalActivity"). Also, to be sure that you do not run pluralization, escape it in the OnModelCreating like this: http://stackoverflow.com/a/4797180/1534753 – Vedran Mandić Mar 15 '16 at 20:49
  • Thanks, I sort of solved the problem, though didn't find out why it only did it to this table. I just added a 1 at the end of the table in the model and left the dbase table as is, and it worked.. Go figure... thanks for the help.. – jamesT Mar 16 '16 at 17:49

0 Answers0