Skip to main content.

Site Map

Site Map

API Project

The API project contains all broadcasts, clients, events, DTOs, interfaces and processes used by the Service Brick. It only has a reference to the ServiceBrick NuGet package.

Default File Structure

Dto

This folder contains data transfer objects used to expose data for your service. By default, it will contain one file for each Domain Object being exposed, named [DomainObject Name]Dto.cs.

Extensions

This folder contains (2) two files.

  • ApplicationBuilderExtensions.cs - Provides extension methods for RegisterBrick() and StartBrick()
  • ServiceCollectionExtensions.cs - Provides extension method for AddBrick()

Interface

This folder contains interfaces for exposing the API. By default, it will contain (3) three files for each Domain Object.

  • I[DomainObject Name]ApiClient.cs - Provides the API client interface for calling the microservice synchronously.
  • I[DomainObject Name]ApiController.cs - Provides the API attribute-based controller interface that exposes the API service.
  • I[DomainObject Name]ApiService.cs - Provides the storage provider implementation-specific interface for access persistent data.

Model

This folder contains (2) two files.

  • [Module Name]ApiConstants.cs - Defines shared constants
  • [Module Name]ApiModule.cs - Implements the IModule interface

Service

This folder contains the service clients used to communicate with the service synchronously. By default, it will contain (1) one file for each Domain Object named [DomainObject Name]ApiClient.cs.