Support FirstOrDefaultAsync()
See original GitHub issueIs your feature request related to a problem? Please describe. I’ve recently transitioned to this from my own CosmosDbRepository and I have noticed the method FirstOrDefaultAsync() does not exist in the context of this library. I was wondering if anyone had run into this or was planning on implementing it anytime soon.
Describe the solution you’d like
I would like if the Microsoft.Azure.CosmosRepository.Extensions
was extended to include FirstDefaultAsync()
Describe alternatives you’ve considered Currently I am calling ToListAsync() and then in a following line using first or default.
Additional context I can implement this; I was unsure of your policies on help from others.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
QueryableExtensions.FirstOrDefaultAsync Method
Asynchronously returns the first element of a sequence, or a default value if the sequence contains no elements.
Read more >How to mock an async repository with Entity Framework Core
Object); var service = new CompanyProductService(entityRepository); var result = await service.GetCompanyProductURLAsync(Guid.NewGuid() ...
Read more >FirstOrDefaultAsync is not supported in EF.CompileQuery
FirstOrDefaultAsync is not supported when calling a Compiled Query Exception message: Stack trace: System.NotSupportedException: Could not ...
Read more >FirstOrDefaultAsync Include Problem in API #10200
Hi, I am using the FirstOrDefaultAsync method but the foreignkey table is null. Also does not allow to define Include in FirstOrDefaultAsync ......
Read more >How to Mock EF Core DbContext
This library will help us to mock EF Core contexts and we can test ... such as FindAsync() , ToListAsync() , FirstOrDefaultAsync() ,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@PaulOst I just opened a PR for that an a few additional methods!
Hi @evancjohnson,
We are thrilled to have external contributors provide features, and suggestions - as you’ve done here. When you write a PR, please reference this issue number and tag me for review.