1

I previously followed the below tutorial on Dynamic Data scaffolding with Entity framework: https://www.youtube.com/watch?v=hWatePj2RmE (Part 1 and Part 2) (ASP.net Scaffolding, Dynamic Data with Entity framework)

I used this tutorial to implement a table editing solution, that does the following:

  1. Displays all tables in a given schema (EDT) and allows for a friendly web page to edit the contents.
  2. There are around 300 tables for editing.
  3. When creating or updating provides friendly pick lists to foreign key tables.
  4. All of the tables that we wish to edit are in a schema called "EDT"

The only current draw back is that i have to rebuild the entity model every few weeks (when the schema of the db changes)

I now have new requirements to do the following:

  1. Audit the windows user account

    • CRUD actions logged with change.
    • Windows account recorded.
    • Table name recorded.
  2. FK tables in a read only way

    • Create Foreign Keys to populate picklists.
    • If the Foreign Key is in the dbo schema, this should be read only.

It would also be a huge advantage if i didn't have to rebuild the entity model all the time!

I have tried quite a few different things such as using custom fields, all of which seem to have a massive overhead once the model is refreshed. I also tried creating a MVC solution, however managing 300 controllers that change often is also not practical.

My specific questions are

  1. Is this the best way of creating an ASP site to manage CRUD on 300 tables that change often?
  2. What is the best method to meet the above new requirements?
  3. Is there a way to not have to rebuild the edmx file all the time?
DIG
  • 23
  • 4
  • Is there a reason you have to use EF for this? I would simply use ado.net directly, selecting from master to show the list of tables and get their columns, pks, fks, and even unique indexes. Then I would create a single page to manage all the tables with a dropdown or whatever. maybe have another table that shows which are read only or can be edited. I would post back values with specific column names to dynamically create the model and sql. Then the new logic would be added once and you are done. EF isn't always the best answer. – Daniel Lorenz Jan 09 '18 at 03:43
  • Thanks for your response, only reason for EF and dynamic data was just looking for quick development, there have been 0 bugs found using the above method and it was extremely quick to complete. My requirements seem simple so i was hoping there would be a quick solution. – DIG Jan 09 '18 at 08:17

0 Answers0