4 ms·
I’ve recently been doing it. We use Dapper ORM. It’s super light weight and easiest to make classes that map 1-1 with database columns since Dapper does reflect
by elamje 6y ago
I’ve recently been doing it. We use Dapper ORM. It’s super light weight and easiest to make classes that map 1-1 with database columns since Dapper does reflection to match up property names and column headers.
I’ve found the best way to add some extra view data to a class that is directly backed from a DB table is to inherit from the 1-1 class that Dapper uses, and just add the extra data in the child class.
That way dapper doesn’t get confused by properties not mapped to the database table, but I get to use the extra data properties in my view.