This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Indexed non-AutoProperty properties accessibility error #101
Comments
msawczyn
added
bug
Confirmed bug
pending release
Issue is resolved in the current codebase, will be published with the next release
labels
Sep 30, 2019
Please take a look at the 1.3.0.6 pre-release. Look forward to your feedback. |
msawczyn
added
released
Issue is resolved in a current release
and removed
pending release
Issue is resolved in the current codebase, will be published with the next release
labels
Oct 1, 2019
Thanks for the quick replies and fixes! There are no more compilation errors. I think there's another problem now. Each one of these (Indexed and non-AutoProperty) properties is generating two database fields. Is this necessary? For example, an entity Currency with 3 properties: Code as primary key (Manual Indentity Type) and Name and Symbol are Indexed and non-AutoProperty, generates a table with 5 fields, modelBuilder.Entity<global::BottomUp.Model.Currency>()
.ToTable("Currency")
.HasKey(t => t.Code);
modelBuilder.Entity<global::BottomUp.Model.Currency>().HasIndex("_Name")
.IsUnique();
modelBuilder.Entity<global::BottomUp.Model.Currency>().HasIndex("_Symbol")
.IsUnique();
modelBuilder.Entity<global::BottomUp.Model.Currency>()
.Property(t => t.Code)
.IsRequired()
.HasField("_Code")
.UsePropertyAccessMode(PropertyAccessMode.Property)
.ValueGeneratedNever();
modelBuilder.Entity<global::BottomUp.Model.Currency>()
.Property(t => t.Name)
.IsRequired()
.HasField("_Name")
.UsePropertyAccessMode(PropertyAccessMode.Property);
modelBuilder.Entity<global::BottomUp.Model.Currency>()
.Property(t => t.Symbol)
.IsRequired()
.HasField("_Symbol")
.UsePropertyAccessMode(PropertyAccessMode.Property); Which generates the following (initial) migration: migrationBuilder.CreateTable(
name: "Currency",
schema: "dbo",
columns: table => new
{
Code = table.Column<string>(nullable: false),
Name = table.Column<string>(nullable: false),
Symbol = table.Column<string>(nullable: false),
_Name = table.Column<string>(nullable: true),
_Symbol = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Currency", x => x.Code);
}); I think the |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Creating a property with
AutoProperty
set to false andIndexed
set to true generates code with a compile-time error.The error is
CS0122 'Country._ISO' is inaccessible due to its protection level
.Should this combination not be possible or is it a bug?
The text was updated successfully, but these errors were encountered: