3
pr0t0n
8y

Fuck entity framework code first! It's a pain in the ass making relationships work with code first! 😑😑

Comments
  • 1
    Where you watching my computer for the last hour?
  • 0
    @manFrame lol 😂😂😂
  • 0
    I hate it too. I use EF to connect to the data but build the db and code separately. I find that is not harder to do it that way and you have total control.
  • 0
    @georgelynch how do you build db and code separately? Code first, right?
  • 1
    @zeprod I design and create the database tables first, then I create the model classes based the database tables. Add Database.SetInitializer<MyStoreContext>(null);
    to Application.Start. This keeps visual studio from running entity migrations. I keep my db context real lean, mainly just using it to map my model classes to my database classes. For large apps I create query and command classes otherwise I just query db context in the controller actions. I have an example on github https://github.com/dtinsley333/....
  • 0
    @georgelynch got ya! Cool.
Add Comment