Linq2Db does it via T4 Template generation, so you can play with it more if you want [0]
[0] - https://github.com/linq2db/linq2db/blob/64a0db9a9ed7787ff755...