Onion Architecture- Entity Framework Code First Models DataAnnotations
问题 I am developing a ASP.NET MVC Project following the Onion Architecture. I have added the Models inside my Core Project and these Models will be referred as the POCO classes for the Entity Framework Models in the Infrastructure Project. My question is how can I add Data Annotations Which depends on the Entity Framework? Can I make the Core Models as Interfaces and inherit it in the Infrastructure Projects and do real Implementation? 回答1: You don't need to create Core Models as Interfaces if