简体   繁体   中英

Fluent NHibernate: SQLite in-memory database and GUID generated on insert

I'm using SQLite in-memory database for testing purposes. One of the entities has a column map that generate GUID on insert operation.

this.Map(v => v.Code).Generated.Insert().ReadOnly();

First of all GUID doesn't get generated and every record inserted has an empty GUID. Secondly, I cannot retrieve an entity by empty GUID.

this.Session.Query<Entity>().FirstOrDefault(e => e.Code == code);

Everything is fine when I generate GUID on the client side manually prior to saving entity.

Anyone has a similar issue?

Thanks

How Connection string look like? Maybe "data source=:memory:;BinaryGuid=False" fixes this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM