//---------------------------------------------------------------------------------------------
// This file was AUTO-GENERATED by "EF Domain Objects" Xomega.Net generator.
//
// Manual CHANGES to this file WILL BE LOST when the code is regenerated.
//---------------------------------------------------------------------------------------------

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace AdventureWorks.Services.Entities
{
    public class CreditCardConfig : IEntityTypeConfiguration<CreditCard>
    {
        public void Configure(EntityTypeBuilder<CreditCard> c)
        {
            c.ToTable("CreditCard", "Sales")
             .HasKey(e => e.CreditCardId);

            // configure properties
          
            c.Property(e => e.CreditCardId)
             .HasColumnName("CreditCardID")
             .HasColumnType("int")
             .IsRequired()
             .ValueGeneratedOnAdd();

            c.Property(e => e.CardType)
             .HasColumnName("CardType")
             .HasColumnType("nvarchar")
             .HasMaxLength(50)
             .IsUnicode()
             .IsRequired();

            c.Property(e => e.CardNumber)
             .HasColumnName("CardNumber")
             .HasColumnType("nvarchar")
             .HasMaxLength(25)
             .IsUnicode()
             .IsRequired();

            c.Property(e => e.ExpMonth)
             .HasColumnName("ExpMonth")
             .HasColumnType("tinyint")
             .IsRequired();

            c.Property(e => e.ExpYear)
             .HasColumnName("ExpYear")
             .HasColumnType("smallint")
             .IsRequired();

            c.Property(e => e.ModifiedDate)
             .HasColumnName("ModifiedDate")
             .HasColumnType("datetime")
             .IsRequired();

        }
    }
}