Why is EF trying to insert NULL in id-column?

前端 未结 9 2127
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 00:43

I am writing my project using Entity Framework 4.0 (Model first). At the beginning of the project, I faced with this problem: I am trying to insert the filled object in the

9条回答
  •  我在风中等你
    2020-12-10 01:31

    0

    İf you dont use code first or db first oracle dont create be sequnce You try it trigger with sequence

         CREATE OR REPLACE TRIGGER 
    "a"."IHALEYOL"
    before insert on "a"."IHALEYOL"
    for each row
    begin
      select "a"."SQ_DIREK".nextval into :new."ID" from dual;
    end;
    

    seq:

     create sequence SQ_YETKI
    minvalue 1
    maxvalue 9999999999999999999999999999
    start with 221
    increment by 1
    cache 20;
    

提交回复
热议问题