Skip to content

How to apply the .ToListAsync();? #71

@MiBuena

Description

@MiBuena

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!

https://github.com/MiBuena/ListGeneratorAsync/blob/19093c731337d7b1b2a91963e047873142f4d9de/ListGeneration.Data/Repositories/EfRepository.cs#L30

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions