Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: Scaffolding Controllers does not work

$
0
0
I apologize I'm late to the discussion,

I was able to get the scaffolding working, of course with extra effort. I didn't have to change my scaffolding template even though I started down that path based on Google searches and given direction. Here are steps I took to get it working.
  1. Commented out any modelBuilder.Configurations.Add in the OnModelCreating in the context class with composite keys.
  2. Added the connection strings to the app.config for my entity and mapping class projects
  3. Added the [key] attributes to all entities except composite keys (ok this was weird but the scaffolding kept prompting an error that a key was needed even though the mapping had it)
  4. Another weird item, any entities that have composite keys (AspNetUserLogins, AspNetUserRoles) that are referenced will need to be commented out also (entity and mapping classes).
  5. Optional: Until you generate the scaffolding you may need to comment out composite key classes and project file entries.
After the steps, everything worked like a charm. Do not ask me how I figured this out. It's tedious and painful debugging Visual Studio to figure out what the heck is going on. With that said the Scaffolding is incorrect. I did dive into it but after a bit, I realized that debugging Visual Studio was much simpler than trying to development new or revised scaffolding.

Hope this help.

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>