entitytypebuilder <>不包含has的定义

时间:2019-04-21 16:53:49

标签: asp.net-core ef-code-first entity-framework-core asp.net-core-2.1 ef-fluent-api

我有以下代码

using System;
using IranKala.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace IranKala.Persistence.Configurations
{
    public class PriceConfiguration : IEntityTypeConfiguration<Price>
    {
        public void Configure(EntityTypeBuilder<Price> builder)
        {
            builder.HasKey(e => e.PriceId);
            builder.Property(e => e.PriceId).ValueGeneratedOnAdd();
            builder.HasRequired
        }
    }
}

,当我尝试使用此enter link description here

时收到以下错误消息
  

entitytypebuilder <>不包含hasrequired的定义

0 个答案:

没有答案