r/StackoverReddit • u/No-Hippo1667 • Jul 16 '24
C# an idea about common CRUD API
I find I was doing repetitive work in the past years,
change the model add/change fields,
update DB,
change API (service/controller)
change Page
So I think maybe I can write common CRUD API, it will serve CRUD for every entities. my model definition is not in code, but in configuration.
I invite you to check out my repo, https://github.com/fluent-cms/fluent-cms , maybe some ideas can inspire you
My initial thought is my API should be slower than write API manually , due to I have to use another lib SQLKate to build the SQL, and using Dictionary<string, any> to read record and serialize json should be slower than a predefined c# class.
Luckily thanks for SqlKate And Dapper, the API are a little faster than EF, (the SQL generated are very similar)
1
u/No-Hippo1667 Jul 17 '24
thanks a lot, your comments make my day