User-271186128 posted
Hi muybn,
The definition of DbModelBuilder. Entity is:
public virtual EntityTypeConfiguration<TEntityType> Entity<TEntityType>() where TEntityType : class;
As you can see, I takes no arguments. So I suggest you could use Fluent Api as followings:
modelBuilder.Entity<InstructionalMaterials>().HasKey(e => e.InstructionalMaterialId).HasName("PK_InstructionalMaterials");
modelBuilder.Entity<InstructionalMaterials>().ToTable("InstructionalMaterials", "DIMS");
modelBuilder.Entity<InstructionalMaterials>().Property(e => e.Copyright).HasColumnType("datetime2(3)").HasDefaultValueSql("getdate()");
modelBuilder.Entity<InstructionalMaterials>().Property(e => e.Price).HasColumnType("decimal");
modelBuilder.Entity<InstructionalMaterials>().entity.Property(e => e.Status).IsRequired();
modelBuilder.Entity<InstructionalMaterials>().entity.Property(e => e.Title).IsRequired();
More about Entity Framework Fluent Api, please refer to the following link:
https://msdn.microsoft.com/en-us/library/jj591617(v=vs.113).aspx
If you have any other questions, please feel free to contact me any time.
Best Regards,
Dillion