Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate IQueryable<> is valid #4580

Merged
merged 6 commits into from
Jul 24, 2024
Merged

Validate IQueryable<> is valid #4580

merged 6 commits into from
Jul 24, 2024

Conversation

viceroypenguin
Copy link
Contributor

Part of #4475

@viceroypenguin
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sdanyliv
Copy link
Member

sdanyliv commented Jul 19, 2024

I do not see reason why you have added this validation. In 95% it is not needed. Just build tree. Validation needed only for Async methods.

ProcessSourceQueryable was introduced for supporting EF Core's Query Provider.

@linq2dbot
Copy link

Test baselines changed by this PR. Don't forget to merge/close baselines PR after this pr merged/closed.

@MaceWindu
Copy link
Contributor

@sdanyliv we discussed it before - if we validate correctness of call for async, it will be strange to not do it for sync apis

@MaceWindu MaceWindu added this to the 6.0.0-preview.2 milestone Jul 19, 2024
@viceroypenguin
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@viceroypenguin
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -252,7 +253,7 @@ public static IEnumerable<TSource> DeleteWithOutput<TSource>(this IQueryable<TSo
/// <item>SQL Server 2005+</item>
/// </list>
/// </remarks>
public static Task<int> DeleteWithOutputIntoAsync<TSource,TOutput>(
public static async Task<int> DeleteWithOutputIntoAsync<TSource,TOutput>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know Microsoft recommends to add unnecessary async contexts for better stack trace, but I don't think we should do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll disagree with you, but I'm good with it either way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well:

  1. we don't use this approach anywhere else
  2. it goes in different direction with Possible Feature/Enhancement: Pooling Tasks? #3437. But personally I don't expect changes like that could be an improvement for such heavy-weight task as ORM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Valid, then yeah, it's worth having a conversation at some point.
  2. For an ORM, where a majority of the time is gonna be db related, and heavy allocations due to loading objects, I'm less concerned about the allocation of a Task, and more concerned about having accurate stack traces.

@viceroypenguin
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MaceWindu MaceWindu merged commit fb03f08 into master Jul 24, 2024
67 checks passed
@MaceWindu MaceWindu deleted the features/validate-source branch July 24, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants