using Microsoft.EntityFrameworkCore; using Quadarax.Application.QLiberace.Common.Entities.Base.DaoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Quadarax.Application.QLiberace.Base.Entities.DaoMapper { public class CurrencyDm: TrackedDm { public override void Map(ModelBuilder builder) { if (builder == null) throw new ArgumentNullException(nameof(builder)); base.Map(builder); builder.Entity(entity => { entity.ToTable(Constants.Modules.Base.TblCurrency, Constants.Modules.Base.Schema); // indexes entity.HasIndex(e => e.Code, "IDX_CURRENCY_CODE") .IsUnique(); // columns entity.Property(e => e.Code).IsRequired() .HasMaxLength(5) .HasComment("Currency code. Main key to search."); entity.Property(e => e.Name).IsRequired() .HasMaxLength(50) .HasComment("Currency name. Informational value."); entity.Property(e => e.Sign).IsRequired() .HasMaxLength(3) .HasComment("Currency sign chars"); } ); } } }