I'm struggling on how to setup a new Ecommerce website developed in ASP.NET Core MVC. Right now I have a sort of three-tier architecture. The Presentation layer is based on MVC controllers that do a lot of things: take posted values and do simple validation, build model entities, pass them to the Logics layer for workflow excecution, manage errors and exceptions, persist changes using EF SaveChanges and returns back the model for the view.The Logics layer contains the application workflow, so if I want to insert a new order it receives an Order entity, an Address, a list of OrderItem, and simply calls the Data layer methods after validation.The Data layer contains one repository for each entity, and I feel that this is nothing more than a wrapper for EF methods (Insert, Delete, Modify, List and so on...).I am obviously not satisfied about this structure. A lot of code has been put inside the controllers, while Logics and Data layer simply call one layer after the other without adding any value before calling EF methods.My main problems are:- How to thin the controllers? I tried to add a new Service layer between Presentation and Logics but I think this has become only a way to move code from the controllers to a new sort of helper class.- Where should I call SaveChanges. Logics layer methods could be called in different orders based on different requisites, so I feel I should not make that call in this layer, but in another layer above when all Logics methods have completed their workflow.- I have a lot of interfaces and empty classes that only pass the call to the lower layer. It may seem cleaner at first, but I'm starting to feel that it's only a waste of time and energy.I need some suggestions. It's the first time I develop an application like that, and it's becoming confusing. Thank you!
Good architecture for an ASP.NET Core MVC Ecommerce
mvc;asp.net;entity framework;e commerce;n tier