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
Post a Comment