开发者

How to map boolean with FluentNhibernate and SQLite

开发者 https://www.devze.com 2023-03-08 02:27 出处:网络
I understand I need to save boolean in SQLite as Integer, True/False as 1/0 I guess开发者_如何学Go. But how is this done in the mapping file?

I understand I need to save boolean in SQLite as Integer, True/False as 1/0 I guess开发者_如何学Go. But how is this done in the mapping file?

Do I need to write some custom mapping convention class? I've never done this before, so would be very helpful if someone could offer an example.


You can map it like a any other property. Conversion happens under the covers. So if your entity has something like

public virtual bool IsArchived { get; set; }

the Map file for this property would have an entry like so

Map(x => x.IsArchived);
0

精彩评论

暂无评论...
验证码 换一张
取 消