34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Data.Entity.ModelConfiguration;
|
|
|
|
namespace IntegrationTests.Models.Mapping
|
|
{
|
|
public class NoteMap : EntityTypeConfiguration<Note>
|
|
{
|
|
public NoteMap()
|
|
{
|
|
// Primary Key
|
|
this.HasKey(t => t.Id);
|
|
|
|
// Properties
|
|
this.Property(t => t.NoteDetail)
|
|
.HasMaxLength(4000);
|
|
|
|
this.Property(t => t.Title)
|
|
.IsRequired()
|
|
.HasMaxLength(100);
|
|
|
|
// Table & Column Mappings
|
|
this.ToTable("Note");
|
|
this.Property(t => t.Id).HasColumnName("Id");
|
|
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
|
this.Property(t => t.UserId).HasColumnName("UserId");
|
|
this.Property(t => t.DateAdded).HasColumnName("DateAdded");
|
|
this.Property(t => t.NoteDetail).HasColumnName("NoteDetail");
|
|
this.Property(t => t.DomainId).HasColumnName("DomainId");
|
|
this.Property(t => t.SystemAttributeId).HasColumnName("SystemAttributeId");
|
|
this.Property(t => t.Title).HasColumnName("Title");
|
|
}
|
|
}
|
|
}
|