Road WEBAPI Practice (a)

Objective: webapi developed under netcore3.x learning environment.

Project: Directory and description

1, AM.Template.Data, persistence, by the example database instance to query the database changes (CURD), operation.

2, AM.Template.Domain, layer field, the field of the solid model for the relationship between design entities, and generate the database tables.

3, AM.Template.Models, output entity corresponds to the ViewModel, for returning the physical format of the interface design.

4, AM.Template.Infrastructure, the service layer, and the interface specific implementation procedures.

5, AM.Template.Web, netcore webapi project, the real start of the project.

6, AM.Template.common, public class methods, some general methods can be placed in this class.

netcore webapi study found advantages:

1, a simple dependency injection, and provides single-mode weight:

  • Transient: Every GetService will create a new instance
  • Scoped: in the same Scope initialization only one instance, can be understood as (a request every level to create only one instance, the same http request will be within a scope)
  • Singleton: Within the entire application life cycle to create only one instance 

problem? :

Feelings please say development areas, but have not been used, and today I do this to build this project, compliance with norms in the field to develop it?

 

Guess you like

Origin www.cnblogs.com/MatureMan/p/12483908.html