Repository and Service, mvcrepository

Source: Internet
Author: User

Repository and Service, mvcrepository

Repository and Service construction in project architecture construction

8. IDAL construction of the project Architecture
  • IBaseDAL defines common addition, deletion, modification, and query
  • IDALCollection defines the interfaces and special methods for each Model

    Note when defining interfaces:

    • The IBaseDAL parent interface must be integrated.
  • IDbContextFactory defines the method for obtaining EF Context
  • IDbSession defines the data interfaces corresponding to each Model
  • IDbSessionFactory defines how to obtain the data warehouse Interface
9. MSSQLDAL construction of the project Architecture
  • BaseDAL implements the methods defined in the IDAL layer IBaseDAL Interface
  • DALCollection defines the classes corresponding to each model and implements the interfaces and special methods for each Model in IDAL layer IDALCollection.

    Note when defining a category:

    • BaseDAL base class must be integrated
    • The interface corresponding to the IDAL layer must be implemented

    Example:

  • DbContextFactory implements the EF context obtaining method defined in the IDAL layer IDbContextFactory Interface

    Using the built-in Cache Policy of dotNet,System. Runtime. Remoting. Messaging. CallContextImplement caching to reduce the new process and improve data operation efficiency.

     

  • DbSession defines and instantiates the data interfaces corresponding to each Model.

  • DbSessionFactory: how to obtain the data warehouse interface in the idal layer IDbContextFactory Interface

    Data Cache uses the cache policy mentioned above

10. Build the project architecture with IBLL
  • IBaseBLL defines common addition, deletion, modification, and query methods and attributes.
  • IBLLCollection defines the interfaces and special methods for each Model.

    Note when defining interfaces:

    • The IBaseBLL parent interface must be integrated.
  • IBLLSession defines the service interfaces corresponding to each Model
  • IBLLSessionFactory defines how to obtain the Service Warehouse Interface

 

11. BLL construction of the project Architecture
  • BaseBLL implements the methods defined in the IBaseBLL interface of the IBLL Layer
  • BLLCollection defines the classes corresponding to each model and implements the interfaces and special methods for each Model in the IBLL layer IBLLCollection.

    Note when defining a category:

    • BaseBLL base class must be integrated
    • The interface corresponding to the IBLL layer must be implemented

    Example:

  • BLLSession defines and instantiates the service interfaces corresponding to each Model.

  • BLLSessionFactory: how to obtain the data warehouse interface in the ibll layer IBLLSessionFactory Interface

  • DbSessionFactory: how to obtain the data warehouse interface in the idal layer IDbSessionFactory Interface

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.