0

I generated the database from the model now I notice that all the tables have an "s" appended to then Userid object transloated to Userids in SQL.

which nwhen I run the code

Userid userid = db.Userids.Find(id);

gives me this error: System.InvalidOperationException: 'The entity type Userid is not part of the model for the current context.'

is the "s" added at the end of all the tables correct?

enter image description here

THIS IS THE ACTUAL ERROR I GET

System.InvalidOperationException
  HResult=0x80131509
  Message=The entity type Userid is not part of the model for the current context.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>
R.Merritt
  • 477
  • 5
  • 17
  • has been a long time, but I think its the olural setting of the generation But, it should judt work if you havnt changed it :/ – Stefan Jul 03 '20 at 20:41
  • Thanks Stefan! what is olural setting of the generation – R.Merritt Jul 05 '20 at 02:43
  • sorry... "Plural" settings. Its the thing which adds the additional `s`. I believe you can override it, so its worth to check it someting strange is going on. e.g.: pending database updates, a `[table("name")]` like override, something in the model creation parr etc – Stefan Jul 05 '20 at 06:04
  • see https://edspencer.me.uk/posts/2012-03-13-entity-framework-plural-and-singular-table-names/ – Stefan Jul 05 '20 at 06:06

0 Answers0