I'm creating a project with Asp.net MVC 5, Web Api 2, and Entity Framework. I'm designing it with an Onion architecture, so I have a DAL, Service and UI layers.
My DAL layer contains a UnitOfWork and Repositories, my Service layer contains services for business cases.
But I have the following questions:
Where do I use unit of work save (or commit) method?, in Services layer or in UI layer? if I use it in Services layer how do I deal with cases that span multiple Services?
I'm using DTOs for webapi operations, should the Services layer return DTOs or the mapping should be done in the UI layer?
Should DTOs be in a separate project or in the UI project? If they are in a separate project should I use MVC attributes for validation?