ASP.NET MVC – Should business logic exist in controllers?

Business logic should really be in the model. You should be aiming for fat models, skinny controllers. For example, instead of having: public interface IOrderService{ int CalculateTotal(Order order); } I would rather have: public class Order{ int CalculateTotal(ITaxService service){…} } This assumes that tax is calculate by an external service, and requires your model to … Read more

Business logic in MVC [closed]

Fist of all: I believe that you are mixing up the MVC pattern and n-tier-based design principles. Using an MVC approach does not mean that you shouldn’t layer your application. It might help if you see MVC more like an extension of the presentation layer. If you put non-presentation code inside the MVC pattern you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)