This seems silly, but I cannot find any example code that shows how to retrieve the last inserted id
when doing an insert query with ExecuteSqlRaw
var sql = @"INSERT INTO [MyDb-Dev].[dbo].[" + table + "] (...) VALUES (...)";
_context.Database.ExecuteSqlRaw(sql);
How do I retrieve the last inserted id
?
Thanks for your help