| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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<Currency>
- {
- public override void Map(ModelBuilder builder)
- {
- if (builder == null) throw new ArgumentNullException(nameof(builder));
- base.Map(builder);
- builder.Entity<Currency>(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");
- }
- );
- }
- }
- }
|