以下方法或属性之间的调用不明确。在 Asp.net Core 上使用 Oracle

问题描述 投票:0回答:1

我正在尝试使用 N 层架构为 .NET 5.0、ORACLE、ASP.NET Identity 构建解决方案。

现在我有这个错误

Error CS0121 以下方法之间的调用不明确或 特性: `Microsoft.EntityFrameworkCore.SqlServerModelBuilderExtensions.UseIdentityColumns(Microsoft.EntityFrameworkCore.ModelBuilder, 整数,整数)'和 'Microsoft.EntityFrameworkCore.OracleModelBuilderExtensions.UseIdentityColumns(Microsoft.EntityFrameworkCore.ModelBuilder, int, int)' ......EXAMPLE_SCHEMA_ContextModelSnapshot.cs

错误在两个.UseIdentityColumns()指令中

{
    [DbContext(typeof(EXAMPLE_SCHEMA_Context))]
    partial class EXAMPLE_SCHEMA_ContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder    modelBuilder)
        {
            modelBuilder
                .HasDefaultSchema("TEST")
                **.UseIdentityColumns()**
                .HasAnnotation("Relational:MaxIdentifierLength", 30)
                .HasAnnotation("ProductVersion", "5.0.1");



            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.Property<int>("Id")
                    .ValueGeneratedOnAdd()
                    .HasColumnType("NUMBER(10)")
                    **.UseIdentityColumn();**

                b.Property<string>("ClaimType")
                    .HasColumnType("NVARCHAR2(2000)");

                b.Property<string>("ClaimValue")
                    .HasColumnType("NVARCHAR2(2000)");

                b.Property<string>("RoleId")
                    .IsRequired()
                    .HasColumnType("NVARCHAR2(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.ToTable("AspNetRoleClaims");
            });


..........
c# asp.net-core entity-framework-core asp.net-identity
1个回答
0
投票

感谢steve-py

就是那个问题,但是很奇怪,文章中报告的机制明确提到了那个库的使用。

© www.soinside.com 2019 - 2024. All rights reserved.