❔ EntityFramework - How do I figure out what ORM expects?
I get an error:
No account.account_id found.So I changed my DB table from accountid to account_id. Now it works as expected. but how do i know in advance what the Database expects? This is EF Core related according to PostgreSQL devs (my DB provider). For example right now EF Core also expects
is_game_master
but i want it to just be gm
Thanks for your time! 8 Replies
So I guess everytime EF Core sees a Capital Letter midname it just replaces it with a _? Anyway to change that?
I guess you're using db-first?
If so, you can use an attribute or fluent config to tell EF which property has which name in the database
I think it's
[ColumnName]
...?Thanks
Then again, if you use db-first then those properties and the appropriate attributes should've been generated...
Huh
I dont think db-first generates any code
Atleast not the way I set it up, but maybe im just doing double work rn
It should
Read up on scaffolding
It takes your database and generates your context and all the entities for you
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.