30 lines
1021 B
C#
30 lines
1021 B
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data.Entity.ModelConfiguration;
|
|
|
|
namespace IntegrationTests.Models.Mapping
|
|
{
|
|
public class FeeCalculationMap : EntityTypeConfiguration<FeeCalculation>
|
|
{
|
|
public FeeCalculationMap()
|
|
{
|
|
// Primary Key
|
|
this.HasKey(t => t.Id);
|
|
|
|
// Properties
|
|
// Table & Column Mappings
|
|
this.ToTable("FeeCalculation");
|
|
this.Property(t => t.Id).HasColumnName("Id");
|
|
this.Property(t => t.ExpenditureCategoryId).HasColumnName("ExpenditureCategoryId");
|
|
this.Property(t => t.MinShot).HasColumnName("MinShot");
|
|
this.Property(t => t.MaxShot).HasColumnName("MaxShot");
|
|
this.Property(t => t.Quantity).HasColumnName("Quantity");
|
|
|
|
// Relationships
|
|
this.HasRequired(t => t.ExpenditureCategory)
|
|
.WithMany(t => t.FeeCalculations)
|
|
.HasForeignKey(d => d.ExpenditureCategoryId);
|
|
|
|
}
|
|
}
|
|
}
|