Need help on devart with entity framework 6.0(Fluent API) and oracle enterprise edition release 12.1.0.2.0 - 64bit
In database we are using sequence and trigger to insert id value for column on insert
Code: Select all
CREATE OR REPLACE TRIGGER TEST_TRG
BEFORE INSERT ON TEST_TABLE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
if :new.ID = 0 then
:new.ID := MYSEQUENCE.nextval;
end if;
END;
Code: Select all
this.Property(t => t.Id).HasColumnName("ID").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
However in above config if we change DatabaseGeneratedOption to none, application adds model in database but do not refreshes id property in model. This implies there is no issue with trigger and sequence in databaseA null store-generated value was returned for a non-nullable member 'Id' of type Test
Please suggest if I am missing any config in entity framework because of which entity framework is not refreshing model property in dbcontext
Thanks