I have a database context service AppDbContext that has been registered with the framework service container. I also have a class CustomerSearch with several methods for retrieving a list of Customer objects based on a searching criterion via the injected AddDbContext. As the Customer just read and does not write, I think it is a good candidate as a static class and no race condition will occur.
Question
If I convert the Customer class to a static class, how can I inject the AppDbContext?
Aucun commentaire:
Enregistrer un commentaire