How to set Arithabort on in Linq to Entities?

前端 未结 1 695
栀梦
栀梦 2021-01-16 03:26

I\'ve found tons of answers for how to set Arithabort on in Linq to SQL, but nothing in Linq to Entities. In Linq to SQL, you can do this:

using (var conn =         


        
相关标签:
1条回答
  • 2021-01-16 03:51

    The SqlConnection is not specific to linq-to-sql or EF, you can still use the code with EF. But you must create an EntityConnection that receives the SqlConnection.

    EntityConnection.CreateCommand creates an EntityCommand, which expects Entity SQL as command text, no raw SQL commands.

    An alternative is to use the context's ExecuteStoreQuery command (ObjectContext), or context.Database.ExecuteSqlCommand (DbContext).

    0 讨论(0)
提交回复
热议问题