Created
September 28, 2017 10:26
-
-
Save ksysiekj/ae6cc115895e71e7cad359010cae8982 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class ShiftMap : IEntityTypeConfiguration<Shift> | |
{ | |
public void Map(EntityTypeBuilder<Shift> builder) | |
{ | |
// table | |
builder.ToTable("Shift", "HumanResources"); | |
// keys | |
builder.HasKey(t => t.ShiftID); | |
// Properties | |
builder.Property(t => t.ShiftID) | |
.HasColumnName("ShiftID") | |
.ValueGeneratedOnAdd() | |
.IsRequired(); | |
builder.Property(t => t.Name) | |
.HasColumnName("Name") | |
.HasMaxLength(50) | |
.IsRequired(); | |
builder.Property(t => t.StartTime) | |
.HasColumnName("StartTime") | |
.IsRequired(); | |
builder.Property(t => t.EndTime) | |
.HasColumnName("EndTime") | |
.IsRequired(); | |
builder.Property(t => t.ModifiedDate) | |
.HasColumnName("ModifiedDate") | |
.IsRequired(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment