Entity Framework: Insert a new record and Update information of this record -
i don't know how can handle situation, can me ?
a. i insert new record table
var news = new news(); news.title = "hello world"; myrepository.insertnews(catid,news); in insertnews() function, call mydbcontext.savechanges(); , new record inserted database. in time, have id of new record.
b. after have id of new records, need call other functions process business , data update new record.
news.metadata = newdata; and call mydbcontext.savechanges();
my system displays error message. the property 'id' part of object's key information , cannot modified.
please me resolve issue. thanks
Comments
Post a Comment