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

25 lines
724 B
C#

using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
namespace IntegrationTests.Models.Mapping
{
public class SystemAttributeMap : EntityTypeConfiguration<SystemAttribute>
{
public SystemAttributeMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Name)
.HasMaxLength(100);
// Table & Column Mappings
this.ToTable("SystemAttributes");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.Type).HasColumnName("Type");
}
}
}