TrackedTenantDm.cs 745 B

1234567891011121314151617181920212223
  1. using Microsoft.EntityFrameworkCore;
  2. namespace Quadarax.Application.QLiberace.Common.Entities.Base.DaoMapper
  3. {
  4. public abstract class TrackedTenantDm<TEntity>: TrackedDm<TEntity> where TEntity : QlbrcEntityTenantCode
  5. {
  6. public override void Map(ModelBuilder builder)
  7. {
  8. if (builder == null) throw new ArgumentNullException(nameof(builder));
  9. base.Map(builder);
  10. builder.Entity<TEntity>(entity =>
  11. {
  12. entity.Property(e => e.TenantCode).IsRequired()
  13. .HasMaxLength(20)
  14. .HasComment("Reference to tenant code that entity belongs");
  15. }
  16. );
  17. }
  18. }
  19. }