using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations.Operations; using Microsoft.EntityFrameworkCore.Migrations.Operations.Builders; using Oqtane.Migrations.Extensions; // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedAutoPropertyAccessor.Global namespace Oqtane.Migrations.EntityBuilders { public class AspNetUserClaimsEntityBuilder : BaseEntityBuilder { private const string _entityTableName = "AspNetUserClaims"; private readonly PrimaryKey _primaryKey = new("PK_AspNetUserClaims", x => x.Id); private readonly ForeignKey _aspNetUsersForeignKey = new("FK_AspNetUserClaims_AspNetUsers_UserId", x => x.UserId, "AspNetUsers", "Id", ReferentialAction.Cascade); public AspNetUserClaimsEntityBuilder(MigrationBuilder migrationBuilder) : base(migrationBuilder) { EntityTableName = _entityTableName; PrimaryKey = _primaryKey; ForeignKeys.Add(_aspNetUsersForeignKey); } protected override AspNetUserClaimsEntityBuilder BuildTable(ColumnsBuilder table) { Id = table.AddAutoIncrementColumn("Id"); UserId = table.AddStringColumn("UserId", 450); ClaimType = table.AddMaxStringColumn("ClaimType", true); ClaimValue = table.AddMaxStringColumn("ClaimValue", true); return this; } public OperationBuilder Id { get; set; } public OperationBuilder UserId { get; set; } public OperationBuilder ClaimType { get; set; } public OperationBuilder ClaimValue { get; set; } } }