Store enum as string in database

后端 未结 3 789
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 22:59

I am experimenting with dapper. I have a class which has an enum and the values are stored as strings in the database.

This works with FluentNHibernate using GenericEnum

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-01 23:02

    Another solution could be to use the new ITypeMap extensability although it is still a bit verbose to implement.

    https://stackoverflow.com/a/12615036/444917

    Map a Uri field using Dapper

提交回复
热议问题