using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace IntegrationTests.Models.Mapping { public class AspNetUserClaimMap : EntityTypeConfiguration { public AspNetUserClaimMap() { // Primary Key this.HasKey(t => t.Id); // Properties this.Property(t => t.ClaimType) .HasMaxLength(4000); this.Property(t => t.ClaimValue) .HasMaxLength(4000); this.Property(t => t.User_Id) .IsRequired() .HasMaxLength(128); // Table & Column Mappings this.ToTable("AspNetUserClaims"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.ClaimType).HasColumnName("ClaimType"); this.Property(t => t.ClaimValue).HasColumnName("ClaimValue"); this.Property(t => t.User_Id).HasColumnName("User_Id"); // Relationships this.HasRequired(t => t.AspNetUser) .WithMany(t => t.AspNetUserClaims) .HasForeignKey(d => d.User_Id); } } }