EnVisageOnline/Beta/Source/IntegrationTests/Models/Mapping/HolidayMap.cs

31 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
namespace IntegrationTests.Models.Mapping
{
public class HolidayMap : EntityTypeConfiguration<Holiday>
{
public HolidayMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(510);
// Table & Column Mappings
this.ToTable("Holiday");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.OccurrenceType).HasColumnName("OccurrenceType");
this.Property(t => t.OccurrenceWeekDay).HasColumnName("OccurrenceWeekDay");
this.Property(t => t.OccurrenceMonthDay).HasColumnName("OccurrenceMonthDay");
this.Property(t => t.OccurrenceMonth).HasColumnName("OccurrenceMonth");
this.Property(t => t.WorkingDay).HasColumnName("WorkingDay");
this.Property(t => t.NonWorkingWeek).HasColumnName("NonWorkingWeek");
}
}
}