retrieve newly inserted record ID with Linq2SQL
- by devmania
hi,
i am using the following
private BlogDataContext db = new BlogDataContext ();
article.Created = DateTime.UtcNow;
article.Modified = DateTime.UtcNow;
db.Articles.InsertOnSubmit(article);
db.SubmitChanges( );
int id = article.Id;
i am wondering is this save, i mean will it give me the Id of the article user inserted or will there be…