Repetitive CRUD work
Hi guys,
I develop web apps mainly for back offices of small companies. Currently I'm working with .NET Core MVC and I'm starting to feel pretty irritated that I have to keep repeating my own code (even though it often is just copy-pasting) and I'm looking for some advice on how to build a setup which automates some of the shittier things I do.
The main thing I currently do for them is creating 4 pages (per entity), you guessed it, Create/Read/Update/Delete pages supporting my Entity Framework code-first backend. So basically what I do is using the EF scaffold command to create these pages & controllers, and then I manually go in and edit all of them so that:
- Create: All datetimes actually have a datetime picker, references to other entities are just a dropdown selection. Make sure the titles and stuff is correct.
- Read: Remove all front-end code and display the data using datatables. Implement back-end datatables support (searching on db level instead of loading all the data)
- Update: Disable any fields that shouldn't be editable + the statements from the create action
- Delete: Most of the time this stays the same
Now I'm wondering if I can make this process more automated, mainly that I don't have to go and fuck around with datatables because that library keeps fucking with me.
If anyone has a suggestion on how to make my work a bit more pleasant, feel free to do so! If you have tips or tricks, feel free to share.
Some more info:
Most of these projects I do have direct communication with EF since the clients don't care about API's / unit testing / ... And if they don't care, they won't pay me for making them. .NET Core Identity is used security wise.
For the front-end I mainly use very basic bootstrap with a little bit of customisation, for all the markup I just use Razor views, currently looking into SPA frameworks (Angular/Blazor, but have yet to start with this).
0 comments:
Post a Comment