DEV Community


Discussion on: Which would be better for career: Laravel or .NET Core?

lanzorg profile image
lanzorg • Edited

The webapi template of ASP.NET uses OpenAPI and the HATEOAS pattern by default now for really clean architecture, Laravel and Lumen don't and it's kinda a pain to do GraphQL or gRPC APIs. Laravel has recently created Jetstream for seamless frontend development but it's still pretty young. Furthermore, ASP.NET Blazor with SSR and WebAssembly is so productive and don't think we can do better.

The coolest stuffs in Eloquent are practically all built in the C# language itself. Migrations exist since the first ASP.NET releases. There are interactive CLI tools like Laravel too, but a lot of devs create them inside Visual Studio because managing thousands of models/entities and their relations is much easier graphically.

I think Taylor created Laravel because .NET was closed source and Symfony was too corporate for him, but now that .NET is fully open source... Moreover, VSCode that is FOSS has an amazing .NET support, most of the time better than the expensive PhpStorm + Laravel Idea combo for PHP/Laravel.

Thread Thread
dgvai profile image
Jalal Uddin Author

My day 2 of learning .NET Core,
*. I have been creating Models like a normal class and defining its props, then adding the repository and it's interface class, that's ok until you go into multiple model and you see code duplication.
*. I wanted to know, that, all models do have some default props like ID, created_at, updated_at and some CRUD ops, like create, find, update, delete, etc, and those I have to implement here (in my beginner case) manually by creating classes. Isn't there any NuGet Packages that does handle this ORM so it saves production time?

Thread Thread
theonlybeardedbeast profile image
TheOnlyBeardedBeast • Edited

crate a base class which has all these properties you need everywhere, then all the new models should extend this base class. You can create a base generic repository using generics. But basically the entity framework contains all these operations if you succesfully created a databasecontext, you can easily do all the things.

I created a snippet for you with these things:

You just need to update the generic repository so it should be based on the BaseEntity class, and then you can add additional logic to the update methods (updating updatedAt property) or you can add a findById method