3 ms·
You can achieve nearly the same thing by creating your Entities, generating migration from them with a single command, migrating your db with another one(or fro
by atraac 5y ago
You can achieve nearly the same thing by creating your Entities, generating migration from them with a single command, migrating your db with another one(or from code on startup) and returning them directly from Controller's method using DB Context. It's honestly not that much more work. It's far from a recommended approach though... Granted, Django Admin is pretty nice and although there are few nugets that try to achieve that I never found them as easy as in Django.
- bayesian_horse 5y agoAt least in the codebase I work on, I need to create an IRequest/IRequestHandler/Validator class triplet for every single endpoint, each in its own files, including all the lines with single braces and using statements for all the magic extension methods and dependency injection constructors. And often I need to add new ViewModels because the mapping doesn't work correctly. DRF is much more convenient.
- atraac 5y agoWell this is because you decided yourself to go that route. Amount of work would be the same in Django if you decided on this particular architecture there. It doesn't change the fact that if you want to do a simple CRUD you can do it equally easy in almost every popular web framework these days, just yolo that shit into your Controller and be done with it. What you're doing is way more maintainable though, especially if you work with an actual team.
- NicoJuicy 5y agoThat's not EF. That's typical cqrs, lol. Here's a scaffolder as an example if you want to automate things like that: https://github.com/ArmandJ77/CQRSAndMediator-Scaffolding https://github.com/ArmandJ77/CQRSAndMediator-Scaffolding