31 lines
988 B
C#
31 lines
988 B
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data.Entity.ModelConfiguration;
|
|
|
|
namespace IntegrationTests.Models.Mapping
|
|
{
|
|
public class Scenario2GroupMap : EntityTypeConfiguration<Scenario2Group>
|
|
{
|
|
public Scenario2GroupMap()
|
|
{
|
|
// Primary Key
|
|
this.HasKey(t => t.Id);
|
|
|
|
// Properties
|
|
// Table & Column Mappings
|
|
this.ToTable("Scenario2Group");
|
|
this.Property(t => t.Id).HasColumnName("Id");
|
|
this.Property(t => t.ScenarioId).HasColumnName("ScenarioId");
|
|
this.Property(t => t.GroupId).HasColumnName("GroupId");
|
|
|
|
// Relationships
|
|
this.HasRequired(t => t.Scenario)
|
|
.WithMany(t => t.Scenario2Group)
|
|
.HasForeignKey(d => d.ScenarioId);
|
|
this.HasRequired(t => t.SystemAttribute)
|
|
.WithMany(t => t.Scenario2Group)
|
|
.HasForeignKey(d => d.GroupId);
|
|
|
|
}
|
|
}
|
|
}
|