Skip to content

Instantly share code, notes, and snippets.

@ksysiekj
Created September 28, 2017 10:31
Show Gist options
  • Save ksysiekj/f6417ed6ccffe6453d0ed9684f63b2ff to your computer and use it in GitHub Desktop.
Save ksysiekj/f6417ed6ccffe6453d0ed9684f63b2ff to your computer and use it in GitHub Desktop.
public class ShiftMap : EntityTypeConfiguration<Shift>
{
public ShiftMap()
{
// Table & Column Mappings
this.ToTable("Shift", "HumanResources");
// Primary Key
this.HasKey(t => t.ShiftID);
// Properties
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ShiftID).HasColumnName("ShiftID").IsRequired();
this.Property(t => t.Name).HasColumnName("Name").IsRequired();
this.Property(t => t.StartTime).HasColumnName("StartTime").IsRequired();
this.Property(t => t.EndTime).HasColumnName("EndTime").IsRequired();
this.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