| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Microsoft.EntityFrameworkCore;
- using Quadarax.Application.QLiberace.Common.Entities.Base.DaoMapper;
- namespace Quadarax.Application.QLiberace.Base.Entities.DaoMapper
- {
- public class TenantDm : TrackedDm<Tenant>
- {
- public override void Map(ModelBuilder builder)
- {
- if (builder == null) throw new ArgumentNullException(nameof(builder));
- base.Map(builder);
- builder.Entity<Tenant>(entity =>
- {
- entity.ToTable(Constants.Modules.Base.TblTenant, Constants.Modules.Base.Schema);
- // indexes
- entity.HasIndex(e => e.Code, "IDX_TENANT_CODE")
- .IsUnique();
- // columns
- entity.Property(e => e.Code).IsRequired()
- .HasMaxLength(20)
- .HasComment("Tenant code. Main key to search.");
- entity.Property(e => e.Name).IsRequired()
- .HasMaxLength(200)
- .HasComment("Tenant name. Informational value.");
-
- entity.Property(e => e.IsLocked).IsRequired()
- .HasDefaultValueSql("0")
- .HasComment("Flag if tenant locked (not accessible)");
- entity.Property(e => e.LastAccess)
- .HasColumnType("datetime")
- .HasComment("Last access (usage) timestamp.");
- }
- );
- }
- }
- }
|