110,561
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
namespace EFCodeFirstWalkthroughModel
{
public class BookConfiguration : EntityConfiguration<Book>
{
public BookConfiguration()
{
this.HasKey(b => b.ISBN);
this.Property(b => b.Title).IsRequired();
this.HasRequired(b => b.Author).WithMany(a => a.Books);
}
}
}