How to generate model from database using Dapper?

前端 未结 8 1350
故里飘歌
故里飘歌 2020-12-13 00:56

I am coming from PetaPoco camp. PetaPoco has a T4 template which generates model from the database. Is anything similar available for Dapper?

I installed Dapper usi

8条回答
  •  北海茫月
    2020-12-13 01:31

    Here's dapper-pocos I made for generating POCOs for Dapper. The solution uses SQL Server's "sp_HELP" and "sp_describe_first_result_set". Give it the name of a stored procedure, or give it a select statement, and it will generate the related POCOs for use with Dapper. The app just passes the stored procedure or select statement to sp_Help and sp_describe_first_result_set, and maps the results to C# data types.

提交回复
热议问题