entity framework cancel long running query

后端 未结 1 663
不知归路
不知归路 2021-01-06 15:49

I am new to the TPL. I am using the TPL to make some async calls to the database. Below the GetDocumentAsync method is called multiple times and do a good job at offloading

相关标签:
1条回答
  • 2021-01-06 16:30

    Async support is part of the upcoming EF6.

    Check out KSA's related blog post for an overview.

    http://odetocode.com/Blogs/scott/archive/2012/08/26/async-in-entity-framework-6-0.aspx

    With that, you'll switch to ToListAsync with a cancellation token.

    http://entityframework.codeplex.com/SourceControl/changeset/view/fe17fe748307#src%2fEntityFramework%2fIQueryableExtensions.cs

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