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

25 lines
675 B
C#

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