Breeze BeforeSaveEntity create new entity for foreign key -


when i'll try create new timeslot want add userid. save all, userid new 1 , code create new user instead of set foreign key.

during debug user.id correct , timeslot.user.id correct.

protected override bool beforesaveentity(entityinfo entityinfo)         {             // return false if don’t want entity saved.             if (entityinfo.entity.gettype() == typeof(timeslot)                 && entityinfo.entitystate == entitystate.added)             {                 var timeslot = (timeslot)entityinfo.entity;                 var user = uow.users.getbyid(userid);                 timeslot.user = user;                 return true;             }             else             {                 return true;             }         } 


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -