I'm trying to figure out how to share my entities between the data, business, and UI tiers. Is it best to create a separate project for these entities that will be referenced by all the tiers? What about Enums and custom exceptions? I have some enums used only by the UI project, and some that are used by the Business. Does this mean I should have two separate Enum folders: one in the Business project and one in the UI? Similarly with Exceptions? Till now, I have been maintaining the entities, enums, and exceptions all in one separate project that are referenced by all the 3 tiers.
My Business project has Manager classes (like ProductManager.cs) which have methods like List GetProducts() and SaveProduct(Product), etc.
You've been doing the right thing. Creating a separate project with all entities are almost always the way to go. If the enums and exceptions are entity-related, they belong in there as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With