Try the Live Demo

Some quick notes about the demo:

  • The demo data will reset every hour
  • The demo application is running in a low service tier and may take a few seconds to spin up.
  • In a real deployment, subdomains can be used to resolve tenants. In the demo, tenants are switched at login with the tenant selection.
  • To see data isolation in action, try logging in as different tenant users.
  • Only the root tenant can access the tenant management area.
  • Only admin level users can access the user administration area.
  • Every tenant has a default admin: admin@email.com
  • The password for all users: Password123!

Thank you for your interest. You can also send a message to learn more about the boilerplate.

asp nano

Please allow 10-15 seconds for the app to boot from a cold start. Try the live demo with the links below:

.NET Solution Guide

Domain Guide

AspNano.Domain is a class library which contains the entity classes.  These entity classes model the underlying database by means of Entity Framework and code-first migrations. Conceptually, The domain project is at the lowest level in the application.

The domain project organizes entities into three folders.

  • Catalog – for business entities
  • Common – for base entities (abstract classes)
  • Multitenancy – for the tenant entity

The domain entities define the business rules in the application. In other words, the classes here create the tables and relationships in a database.

Venue Entity

The Venue entity is a sample business entity. Use it as a guide for creating new entities. It inherits from the AuditableEntity abstract class, which in turn inherits from the, TenantBaseEntity, which inherits from the BaseEntity<Guid>. Generally any entity that is tenant isolated should use a Guid as the ID type.

Tenant Entity

The tenant entity uses magic strings for IDs solely for simplicity. Depending on the needs of your application, tenant attributes like subscription level, expiry dates, etc. can be added here. Migrations for the tenant entity should be run against the BaseDbContext.

Common Entities

The BaseEntity<T> contains one property, Id, which is a generic type. All entities should derive from this directly or indirectly. This class is an abstract class which means that it will only be used to create other entities.

The TenantBaseEntity contains one property, TenantId and implements the IMustHaveTenant interface. Any tenant isolated entities should inherit from this abstract class.

The AuditableEntity class contains properties for CreatedBy, CreatedOn, LastModifiedBy, LastModifiedOn, DeletedBy, DeletedOn, and IsDeleted. It is also an abstract class, and inherits from the BaseEntity. It implements the IAudiableEntity, and ISoftDelete interfaces.

It’s recommended to create entity classes that inherit from AuditableEntity. Entity types that derive from this will have audit field data handled automatically in the OnSaveChanges override (explained in the persistence section of the infrastructure document).

Creating Non-Tenant Entities

To create entities that are visible across all tenants, don’t implement the IMustHaveTenant interface. The recommended approach is to inherit from the BaseEntity directly and implement IAuditableEntity and ISoftDelete if you need those.