In which project to add reference to PetaPoco?

2019-08-18 05:49发布

问题:

I am new to Design Patterns and referring to a book by Scott Millet : Professional ASP.NET Design Patterns.

In the chapter where it discusses "Separation of Concerns", I have added projects accordingly in the Solution Explorer:

Though the book shows examples of Linq2SQL, I want to use PetaPoco Micro-ORM. I therefore installed PetaPoco via Nuget but I am not following whether to add PetaPoco to all the projects or only in the Model and WebUI Project.

This is how NuGet asks for confirmation while adding PetaPoco to projects:

回答1:

You only need it in one project - the Repository one looks like the best candidate in your solution.