How to generate whole boiler plate code for CRUD operations like visual studio using code?

我的未来我决定 提交于 2021-02-18 17:09:49

问题


I am trying to generate CRUD operations for entities of my database tables like with respective endpoints to consume.

It is same as the visual studio generates boiler plate code for Authentication(Account controller),and also crud operation in the form of whole package.

I have came across t4 templates but not getting how to use it to generate crud operations for my database table entities.

I am also trying to generate whole application package with Application name,references(dll),Controller etc.. like how visual studio is generating boiler plate code for CRUD operations for entity framework.

I will pass sql server name,database name,tables for which i want to generate CRUD operations.

I want to generate this on demand with my console application so it should return whole application packages with reference s(all dll) so then i will create zip of that packages and return to user.

For Eg:I want to generate my whole apllication package based on "Application name" as shown in below WebApplication3 project which contains References,Controller which contains crud operations

Can anybody tell me how to do this?


回答1:


You could use a generator like Telosys, it has a C# MVC Template working with entity framework.

If you have a database model, you can pass it to the generator with this template and it will generate a working CRUD application written in C# that you can reuse in your project.

http://telosys.org/

Template to use : https://github.com/telosys-templates-v3/telosys-template-mvc-csharp



来源:https://stackoverflow.com/questions/49209315/how-to-generate-whole-boiler-plate-code-for-crud-operations-like-visual-studio-u

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!