ObjectContext.ExecuteFunction<GetStoredProcedure_Result>("StoredProcedure", parameter);
Does this code cover transaction automatically (by Entity Framework)? Or should I add transaction in the stored procedure as well?
Please provide any links.
In EF6 every stored procedure call is wrapped in Transaction
. But for the earlier versions of EF it will not cover automatically. You need to specify TransactionScope
as following...
using (TransactionScope transaction = new TransactionScope())
{
//your code here
}
For more on transaction follow MSDN .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.