Skip to content

Instantly share code, notes, and snippets.

@ksysiekj
Created September 28, 2017 10:26
Show Gist options
  • Save ksysiekj/ae6cc115895e71e7cad359010cae8982 to your computer and use it in GitHub Desktop.
Save ksysiekj/ae6cc115895e71e7cad359010cae8982 to your computer and use it in GitHub Desktop.
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