dotnet/efcore

commandTimeout for some query only

Open

#18,895 opened on Nov 14, 2019

View on GitHub
 (12 comments) (2 reactions) (0 assignees)C# (3,376 forks)batch import
area-querycustomer-reportedgood first issueneeds-design

Repository metrics

Stars
 (14,651 stars)
PR merge metrics
 (Avg merge 17d 16h) (132 merged PRs in 30d)

Description

some query may take long time to complete, so I'm wondering if we could have an api for set command out for the long-time query only, not global?

maybe an extension method like follows:

var posts = dbContext.Posts.AsNoTracking()
    .Where(p=>p.Tile == "12131313")
    .WithCommandTimeout(20)
    .ToList();

Contributor guide