EnVisageOnline/Main/Source/IntegrationTests/Models/Mapping/StatusMap.cs

30 lines
917 B
C#

using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
namespace IntegrationTests.Models.Mapping
{
public class StatusMap : EntityTypeConfiguration<Status>
{
public StatusMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Name)
.HasMaxLength(200);
this.Property(t => t.Color)
.HasMaxLength(16);
// Table & Column Mappings
this.ToTable("Status");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.Color).HasColumnName("Color");
this.Property(t => t.IsSystem).HasColumnName("IsSystem");
this.Property(t => t.Probability100).HasColumnName("Probability100");
}
}
}