question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support FirstOrDefaultAsync()

See original GitHub issue

Is 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:closed
  • Created a year ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
evancjohnsoncommented, Jul 23, 2022

@PaulOst I just opened a PR for that an a few additional methods!

1reaction
IEvangelistcommented, May 23, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found