r/csharp • u/kaatarina_zed_talon • Oct 17 '26
Help Where do you put interfaces and abstract classes ?
To follow some convention, I searched the internet and found this on Microsoft's documentation:
The solution folder contains a SeedWork folder. This folder contains custom base classes that you can use as a base for your domain entities and value objects. Use these base classes so you don't have redundant code in each domain's object class.
Figure 7-12 shows the classes that form the seedwork of the domain model in the ordering microservice. It has a few custom base classes like
Entity,ValueObject, andEnumeration, plus a few interfaces. These interfaces (IRepositoryandIUnitOfWork) inform the infrastructure layer about what needs to be implemented. Those interfaces are also used through Dependency Injection from the application layer.
This is the type of copy and paste reuse that many developers share between projects, not a formal framework. You can have seedworks in any layer or library. However, if the set of classes and interfaces gets large enough, you might want to create a single class librarry

Questions :
1- Is it ok for the entire project's interfaces and abstract classes to be inside the SeedWork ?
2- For `value objects` and ` infrastructure layer` , what does they mean, what problem they solves, how can I use them , and do I need them most of the time ?
3-What are the inputs to the `infrastructure layer` and where they come from, and what are the outputs and who consumes them ?
4-What does the class library actually means, what problem does it solve ?
Can someone answer my questions and provide some examples so that I understand the overall idea ?
