好的,首先,我想做的是從 Angular 的注冊表中獲取用戶詳細信息,并將這些詳細信息注冊到 SQL Server 數(shù)據(jù)庫中。我一直在關(guān)注幾個教程,我想知道為什么當(dāng)我運行命令進行新遷移時,它會創(chuàng)建一個具有許多不同屬性的表,我沒有指定。例如,默認情況下它會創(chuàng)建以下屬性:migrationBuilder.CreateTable( name: "User", columns: table => new { Id = table.Column<string>(nullable: false), UserName = table.Column<string>(maxLength: 256, nullable: true), NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true), Email = table.Column<string>(maxLength: 256, nullable: true), NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true), EmailConfirmed = table.Column<bool>(nullable: false), PasswordHash = table.Column<string>(nullable: true), SecurityStamp = table.Column<string>(nullable: true), ConcurrencyStamp = table.Column<string>(nullable: true), PhoneNumber = table.Column<string>(nullable: true), PhoneNumberConfirmed = table.Column<bool>(nullable: false), TwoFactorEnabled = table.Column<bool>(nullable: false), LockoutEnd = table.Column<DateTimeOffset>(nullable: true), LockoutEnabled = table.Column<bool>(nullable: false), AccessFailedCount = table.Column<int>(nullable: false) },我不知道這些屬性從何而來,我想知道是否可以更改它。我按照教程制作了一個網(wǎng)站,但現(xiàn)在我正在嘗試自己嘗試一個新項目。所以,問題是,當(dāng)使用 AutoMapper 時,我收到此錯誤消息,我想知道如何解決此問題:AutoMapper 為您創(chuàng)建了此類型映射,但無法使用當(dāng)前配置來映射您的類型。AccountModel -> ApplicationUser(目標(biāo)成員列表) UserWebAPI.Models.AccountModel -> UserWebAPI.Models.ApplicationUser(目標(biāo)成員列表)未映射的屬性: Id NormalizedUserName NormalizedEmail EmailConfirmed PasswordHash SecurityStamp ConcurrencyStamp PhoneNumber PhoneNumberConfirmed TwoFactorEnabled LockoutEnd LockoutEnabled AccessFailedCount
AutoMapper 具有未映射屬性的問題
慕田峪7331174
2023-07-22 17:04:25