Following from this question, I now have the following structure:
Wolfie.Core - contains business logic and entities, also contains repository interfaces (for example, IUserRepository). Classes that need to access the repository use constructor injection.
Wolfie.Data - Links Wolfie.Core and has a UserRepository that implements IUserRepository
So still I am satisfied with this. Core does not know anything about data implementation and, therefore, is not dependent on anything.
The stumbling block that I get is in my web layer.
My web project refers to my main project. Then I can add a new Core class, say User, but I need to pass a specific implementation of IUserRepository. Therefore, I need to refer to my Data project in my web project, which seems to be wrong. Now it also looks like the Web depends on data, which should not be.
So, how can I apply the Core User class to the Data class with a direct link to Data?
Look at your help.
source
share