ASP.NET MVC IOC dependency injection opening series of Autofac

  1. Autofac IOC assembly is achieved inversion control, mainly with oriented programming interface, a large degree of complete decoupling work.
  2. Using the IOC, it must be oriented programming interface, a so-called oriented programming interface, i.e., the program is dependent on the abstract, without depending on the specific implementation.
  3. We need to try to write all the business logic in the service layer, control layer, which do not directly call a database context object, so, separate each operational level area to a certain extent, to better achieve the purpose of decoupling.
  4. Conventions: The controller is no longer calls the database context object, only to realize in the service layer specific calls.
  5. Autofac lifecycle Bowen may refer to: https: //blog.csdn.net/linshichen/article/details/82225274

 

  Reference Hirofumi: Https://Www.Cnblogs.Com/fei686868/p/10979707.Html

  The next chapter, officially entered the theme

Guess you like

Origin www.cnblogs.com/xyh9039/p/11305716.html