DEV Community

loading...

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

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: github.com/TheOnlyBeardedBeast/sni...

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