Can I specify DB column names for dapper-dot-net mappings?

后端 未结 4 554
别跟我提以往
别跟我提以往 2021-02-05 05:04

Is there a way with dapper-dot-net to use an attribute to specify column names that should be used and not the property name?

public class Code
{
    public int          


        
4条回答
  •  情话喂你
    2021-02-05 06:06

    If you are using a select statement directly or in a procedure you can just alias the columns.

    SELECT code as Value FROM yourTable
    

提交回复
热议问题