1

I want to create scaffold item controller and the view from the model in run time I want to make an app that user can change model in run time and it automatically create controller and view based on the new model.

I have found this tutorial from which I learned how to create scaffold in command line in asp.net core MVC but I want to scaffold in asp.net web application .net framework I have found this that has created scaffold in NuGet package but I want to scaffold automatically when user change tables in web site

Pravitha V
  • 3,308
  • 4
  • 33
  • 51
  • What do you want to achieve by run time controller scaffolding? Because generally it is a design and architecture flaw. – Hadee Aug 13 '17 at 23:34
  • I want to have an app that connects to crm and do crud with it. User should can change tables and fields and my app should automatically create controller and view and create forms – fateme zahiri Aug 14 '17 at 18:35
  • I never take this approach, because you can't handle run time errors properly and can't optimize database. – Hadee Aug 14 '17 at 20:51
  • I haven't database my datas are in crm web service i want to connect to it and do crud with data. – fateme zahiri Aug 15 '17 at 06:30
  • My boss has told me take this approch – fateme zahiri Aug 15 '17 at 06:31
  • Which approach you think is better that meet my requirenments? – fateme zahiri Aug 15 '17 at 09:48
  • Not sure about your project details. Can you put some details of what is your use case? – Hadee Aug 15 '17 at 10:25
  • I have a crm web service that have database. my app connects to this crm and have create update and delete views and users can create update and delete crm's datas. users also can create tables in crm, create fields or change field's type and feild's name or change table's name. and my app should automatically create forms and views for that new or changed tables and my app should have the possibility to create and update and delete with that new or changed crm's database – fateme zahiri Aug 15 '17 at 13:14
  • Based on my overall understanding of your project, It is better you create list of twin inputs in your form which one is label and other is input for that field. Then save all in database. It could be `list` of them inside your model to have dynamic number of them. By using jq or js, user can have add button to have as many as he wants of that fields. – Hadee Aug 15 '17 at 20:41
  • Thank you for your help. is this a good approach to create a model 'a' with 3 field string data type and string display name and dynamic field's input. when user creates tables and fields structure based on your comment i will save these structures in a list. and then when user wants to do crud with these dynamic tables i read structures from that list and make an instance of model 'a' of that list's datas and crete updat and delete model a and then save to crm. – fateme zahiri Aug 18 '17 at 13:13
  • Yes, it works for your purpose. I haven't try crm but I tried it with ms sql. But remember one of the twins is only label and the other one is input. So user shouldn't able to edit lable. – Hadee Aug 20 '17 at 20:27
  • tank you for your help – fateme zahiri Aug 21 '17 at 07:01

0 Answers0