Skip to main content.

Site Map

Site Map

MongoDB Project

The MongoDB project contains the storage provider specific implementation of the API services used by the Service Brick. It has a reference to the [Module] and ServiceBrick.Storage.MongoDb NuGet packages.

Default File Structure

Domain

This folder contains the Domain Object classes used by the storage providers to store persistent data. By default, it will contain one file for each Domain Object being exposed, named [DomainObject Name].cs.

Extensions

This folder contains (2) two files.

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

Mapping

This folder contains the AutoMapper Profile classes used to map data from a DomainObject to a Data Transfer Object. By default, it will contain one file for each Domain Object to DTO relationship, named [DomainObject Name]MappingProfile.cs.

Model

This folder contains (2) two files.

  • [Module Name]MongoDbConstants.cs - Defines shared constants
  • [Module Name]MongoDbModule.cs - Implements the IModule interface

Rule

This folder contains business rules defined for the Service Brick. By default, it will contain one file used to map the StorageKey property to the primary key of the Domain Object. It is named [DomainObject Name]QueryRule.cs.

Service

This folder contains the API service implementation for the domain object. By default, it will contain one file for each Domain Object, named [DomainObject Name]ApiService.cs.

Storage

This folder contains storage provider-specific repository functionality for the Service Brick. By default, it will contain one file, named [Module Name]StorageRepository.cs.