c# - Entity Framework Core + Npgsql driver: Incorrect default GUID inserts if a complex alternate key exists -


i'm using npgsql.entityframeworkcore.postgresql vesrion 1.0.0 , microsoft.entityframeworkcore version 1.0.0.

i have following in onmodelcreating:

builder.haspostgresextension("uuid-ossp");  builder.entity<questionnairelogic>().property(l => l.evaluatedanswer).hasdefaultvalue(guid.empty); builder.entity<questionnairelogic>().property(l => l.questiontojump).hasdefaultvalue(guid.empty);  builder.entity<questionnairelogic>().hasalternatekey(l => new {     l.actionwhen,     l.questionid,     l.evaluatedanswer,     l.evaluatedvalue,     l.operation }); 

evaluatedanswer , questiontojump both have empty guid default, evaluatedanswer included in alternate key. database created correctly.

if write explicitly:

questionnairelogic logic = new questionnairelogic(); logic.evaluatedanswer = guid.empty; logic.questiontojump= guid.empty; 

then after _context.logic.add(logic); logic.evaluatedanswer have new guid. in previous version (rc-1 @ least) property set empty guid expected.

is current behaviour correct?

link issue: https://github.com/npgsql/npgsql.entityframeworkcore.postgresql/issues/69


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -