How to get Dapper to ignore/remove underscores in field names when mapping?

前端 未结 2 532
离开以前
离开以前 2021-02-02 08:51

There are many ways to map database field names to class names, but what is the simplest way to just remove the underscores?

    public IEnumerable

        
2条回答
  •  温柔的废话
    2021-02-02 09:33

    The readme doesn't show any support for renaming columns. You could alias them in select:

    select person_id as personid, full_name as fullname from fn_get_person();
    

    as suggested in this answer.

提交回复
热议问题