EnVisageOnline/Main-RMO/Source/IntegrationTests/Models/Mapping/UOMMap.cs

26 lines
713 B
C#

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