//---------------------------------------------------------------------------------------------
// 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 EmployeeConfig : IEntityTypeConfiguration<Employee>
    {
        public void Configure(EntityTypeBuilder<Employee> c)
        {
            c.ToTable("Employee", "HumanResources")
             .HasKey(e => e.BusinessEntityId);

            // configure relationships

            c.HasOne(e => e.BusinessEntityObject)
             .WithOne()
             .HasForeignKey<Employee>(e => e.BusinessEntityId);

            // configure properties
          
            c.Property(e => e.BusinessEntityId)
             .HasColumnName("BusinessEntityID")
             .HasColumnType("int")
             .IsRequired()
             .ValueGeneratedNever();

            c.Property(e => e.NationalIdNumber)
             .HasColumnName("NationalIDNumber")
             .HasColumnType("nvarchar")
             .HasMaxLength(15)
             .IsUnicode()
             .IsRequired();

            c.Property(e => e.LoginId)
             .HasColumnName("LoginID")
             .HasColumnType("nvarchar")
             .HasMaxLength(256)
             .IsUnicode()
             .IsRequired();

            c.Property(e => e.OrganizationLevel)
             .HasColumnName("OrganizationLevel")
             .HasColumnType("smallint")
             .ValueGeneratedOnAddOrUpdate();

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

            c.Property(e => e.BirthDate)
             .HasColumnName("BirthDate")
             .HasColumnType("date")
             .IsRequired();

            c.Property(e => e.MaritalStatus)
             .HasColumnName("MaritalStatus")
             .HasColumnType("nchar")
             .HasMaxLength(1)
             .IsUnicode()
             .IsFixedLength()
             .IsRequired();

            c.Property(e => e.Gender)
             .HasColumnName("Gender")
             .HasColumnType("nchar")
             .HasMaxLength(1)
             .IsUnicode()
             .IsFixedLength()
             .IsRequired();

            c.Property(e => e.HireDate)
             .HasColumnName("HireDate")
             .HasColumnType("date")
             .IsRequired();

            c.Property(e => e.SalariedFlag)
             .HasColumnName("SalariedFlag")
             .HasColumnType("bit")
             .IsRequired();

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

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

            c.Property(e => e.CurrentFlag)
             .HasColumnName("CurrentFlag")
             .HasColumnType("bit")
             .IsRequired();

            c.Property(e => e.Rowguid)
             .HasColumnName("rowguid")
             .HasColumnType("uniqueidentifier")
             .IsRequired();

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

        }
    }
}