How To Use Dapper For Mysql In C
Few days ago I look for a solution so I can just save my time writing CRUD. So I found a solution. It’s called Dapper.
For creating c# class from the database you can use this code
https://gist.github.com/anirugu/9fb82ce773c45578f42f7a6d899f3221
later add Dapper into your project and add Dapper.Contrib
now you don’t need to write a open Datareader and write some reading writing code again and again.
Dapper.Contrib give you some cool functionality like Insert and Update. You still need to write your SQL queries but it’s going to be good and easier to maintain the code. Last year I was working on a c# project and project become full mess of these code. With one line of SELECT , INSERT OR UPDATE code and 100 line of code later to just read those things from DataReader.
Dapper can save a lot of your time doing those same repeated thing and do it pretty well.
https://github.com/StackExchange/Dapper
https://stackoverflow.com/questions/tagged/dapper
Happy Coding