Service & DAL Resolution in CelloSaaS

CelloSaaS uses unity to resolve the DAL & Services. During run-time if a DAL or a Service is not registered with Unity.config, CelloSaaS tries to resolve them using name convention.


The following steps are to be followed when the Services and DAL are not registered via Unity.


CelloSaaS follows the naming convention to resolve the Services and DAL at run time for Dependency Injection if not registered with Microsoft Unity in the Configuration [WebApp\Config\Unity.config].


In Service Layer

  • Create a Service Contract with the name that should start with "I" followed by contract name and with the suffix "Service" ( I{ContractName}Service.cs )
ED            Example:

          Contract         :  IProjectService.cs 

          Namespace    : ProjectManagement.ServiceContracts.IProjectService.cs

  • Create a Service that implements the corresponding service contract and that name should be starting with service name and with suffix as  "Service" ({ServiceName}Service.cs
          Example:

          Class Name :  ProjectService.cs 

          Name Space    : ProjectManagement.Services.ProjectService.cs


In 

In DAL Layer:


  • Create a IDAL (Interface for data access layer) with the name starting with "I" followed by DAL name and end with "DAL" ( I{DALName}DAL.cs )

          Example:

          Interface Name :  IProjectDAL.cs 

          Name Space    : ProjectManagement.DAL.IProjectDAL.cs

  • Create a DAL that should implement the corresponding IDAL with name that should be starting with DAL name and end with "DAL" ({DALName}DAL.cs

          Example:

          Class Name :  ProjectService.cs 

          Name Space    : ProjectManagement.SqlDAL.ProjectDAL.cs


If you follow the naming convention method mentioned above, CelloSaaS will automatically resolve the Services and DAL at runtime.


Note: It is recommended to resolve the DAL & Services via Unity