I have a .net solution I'm creating to support generating postal labels for orders. The orders are coming from eBay with payments from Paypal. The postage service used is Royal Mail Post. As I may reuse the the eBay, Paypal and Royal Mail items in future solutions it made sense for me to create five projects:
- MVC Application - provide user interface
- Core class libary - Contains shared classes like Country, Currency, etc
- Royal Mail class library
- eBay class library
- Paypal class library
I've placed the POCOs in the appropriate class library. For example, Royal Mail class library has POCOs Shipment, PostageType, etc. The MVC application has an IdentityDbContext class declaring DBSets for the POCOs from the referenced class libraries.
To my thinking the MVC app is the only project which should have the Entity Framework referenced. The issue I have is I need to add the data annotations to the POCOs; such as Key, Index, etc. Does this mean I need to reference EF in each of the class libraries? I thought about using Fluent API but I want the annotations in the class libraries so that they can be seen by other solutions using the class library.
Thanks for any help!