此行是警告错误,一旦移至EF 3.0,我找不到HasDefaultValue()扩展方法
using MGame.Core;
using MGame.Model;
using MGame.Model.Enums;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
namespace MGame.Data.DataContextConfigurations
{
public class AddressConfiguration : DataContextBaseEntityTypeConfiguration, IEntityTypeConfiguration<Address>
{
public void Configure(EntityTypeBuilder<Address> builder)
{
builder.Property(e => e.AddressTypeId).IsRequired().HasDefaultValue(0);
也失败了
builder.ToTable(nameof(AncestorRegionView));
以及
builder.Metadata.IsQueryType = true;
答案 0 :(得分:0)
我只需要添加对软件包Microsoft.EntityFrameworkCore.Relational
的引用:
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0" />