NikolayIT / NikolayIT/ASP.NET-Core-Template
How to apply the .ToListAsync();?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 174
- Avg merge
- 7m
- Merged PRs (30d)
- 1
Description
In asynchronous programming there is a very useful async method: ToListAsync();
However, it comes from EntityFramework. So basically if we use the template here and call .All(); method in the Service and after that call .ToListAsync() in the service - then we will create a dependency between the Service and EF.
Perhaps I should add a wrapper method for this in the generic repository like I have done it here:
Or maybe there is a better way? Let me know your thoughts!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked EfRepository.cs example at line 30, then trace how the template's service calls All() and where ToListAsync() would be introduced. Resolve which repository or service boundary should own the Entity Framework dependency; done requires a clear, agreed design for asynchronous list retrieval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, database
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100