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

Add support in DomainServiceTestHost for asynchronous queries that return a single entity #464

Merged
merged 3 commits into from
Dec 18, 2023

Conversation

erikoijwall
Copy link
Contributor

@erikoijwall erikoijwall commented Nov 23, 2023

Add support in DomainServiceTestHost for asynchronous queries that return a single entity
QuerySingleAsync with two overloads
Expression<Func<TDomainService, TEntity>> queryOperation
Expression<Func<TDomainService, Task<TEntity>>> queryOperation

Added overload for TryQuerySingle to handle async query

Erik Öijwall added 2 commits November 23, 2023 10:36
* QuerySingleAsync with two overloads
Expression<Func<TDomainService, TEntity>>,
Expression<Func<TDomainService, Task<TEntity>>> queryOperation
* Added overload for TryQuerySingle to handle async query
@erikoijwall
Copy link
Contributor Author

@dotnet-policy-service agree

Copy link
Member

@Daniel-Svensson Daniel-Svensson left a comment

Choose a reason for hiding this comment

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

It seems that you changed CityDomainService so that there is a failing code generation test, which needs to be resolved.

You can run TestCityClientProxies and look at the output for instructions of how to update the code generation baseline.

The alternative is to use the AsyncServerSideDomainService (or similar named domain service) instead, it should have a queriy returning Task

Copy link

sonarcloud bot commented Dec 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@Daniel-Svensson Daniel-Svensson left a comment

Choose a reason for hiding this comment

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

This looks good so Feel free to merge @erikoijwall or @SandstromErik
I am wondering if we in the future should allow "Query" to be used for single entity returning methods as well (just add overloads which calls Single...)

@erikoijwall erikoijwall merged commit 27c1999 into main Dec 18, 2023
7 checks passed
@erikoijwall erikoijwall deleted the feature/support_querysingle_domainservicetesthost branch December 18, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants