27 lines
871 B
C#
27 lines
871 B
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data.Entity.ModelConfiguration;
|
|
|
|
namespace IntegrationTests.Models.Mapping
|
|
{
|
|
public class SecurityMap : EntityTypeConfiguration<Security>
|
|
{
|
|
public SecurityMap()
|
|
{
|
|
// Primary Key
|
|
this.HasKey(t => new { t.PrincipalId, t.SecurityObject });
|
|
|
|
// Properties
|
|
this.Property(t => t.SecurityObject)
|
|
.IsRequired()
|
|
.HasMaxLength(50);
|
|
|
|
// Table & Column Mappings
|
|
this.ToTable("Security");
|
|
this.Property(t => t.PrincipalId).HasColumnName("PrincipalId");
|
|
this.Property(t => t.Read).HasColumnName("Read");
|
|
this.Property(t => t.Write).HasColumnName("Write");
|
|
this.Property(t => t.SecurityObject).HasColumnName("SecurityObject");
|
|
}
|
|
}
|
|
}
|