Revert changes to the 2.0 templates that were unintentionally copied from dotnet/templating (#135)

This commit is contained in:
Nate McMaster 2017-10-30 15:49:46 -07:00 committed by GitHub
parent a7f5459608
commit f0991b4e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 84 additions and 95 deletions

View File

@ -12,6 +12,8 @@ namespace Company.WebApplication1.Pages.Account.Manage
{ {
public class TwoFactorAuthenticationModel : PageModel public class TwoFactorAuthenticationModel : PageModel
{ {
private const string AuthenicatorUriFormat = "otpauth://totp/{0}:{1}?secret={2}&issuer={0}";
private readonly UserManager<ApplicationUser> _userManager; private readonly UserManager<ApplicationUser> _userManager;
private readonly SignInManager<ApplicationUser> _signInManager; private readonly SignInManager<ApplicationUser> _signInManager;
private readonly ILogger<TwoFactorAuthenticationModel> _logger; private readonly ILogger<TwoFactorAuthenticationModel> _logger;
@ -48,4 +50,4 @@ namespace Company.WebApplication1.Pages.Account.Manage
return Page(); return Page();
} }
} }
} }

View File

@ -17,85 +17,17 @@ namespace Company.WebApplication1.Data.Migrations
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618
modelBuilder modelBuilder
#if (UseLocalDB) #if (UseLocalDB)
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452") .HasAnnotation("ProductVersion", "1.0.0-rc3")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
#else #else
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); .HasAnnotation("ProductVersion", "1.0.2");
#endif #endif
modelBuilder.Entity("Company.WebApplication1.Models.ApplicationUser", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.Property<string>("NormalizedUserName")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id");
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken(); .IsConcurrencyToken();
@ -117,7 +49,6 @@ namespace Company.WebApplication1.Data.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedName") b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex"); .HasName("RoleNameIndex");
b.ToTable("AspNetRoles"); b.ToTable("AspNetRoles");
@ -189,6 +120,8 @@ namespace Company.WebApplication1.Data.Migrations
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("AspNetUserRoles"); b.ToTable("AspNetUserRoles");
}); });
@ -207,10 +140,75 @@ namespace Company.WebApplication1.Data.Migrations
b.ToTable("AspNetUserTokens"); b.ToTable("AspNetUserTokens");
}); });
modelBuilder.Entity("Company.WebApplication1.Models.ApplicationUser", b =>
{
b.Property<string>("Id");
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Email")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.Property<string>("NormalizedUserName")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
#if (UseLocalDB)
.HasAnnotation("MaxLength", 256);
#else
.HasMaxLength(256);
#endif
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex");
b.ToTable("AspNetUsers");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany() .WithMany("Claims")
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
@ -218,7 +216,7 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.HasOne("Company.WebApplication1.Models.ApplicationUser") b.HasOne("Company.WebApplication1.Models.ApplicationUser")
.WithMany() .WithMany("Claims")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
@ -226,7 +224,7 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{ {
b.HasOne("Company.WebApplication1.Models.ApplicationUser") b.HasOne("Company.WebApplication1.Models.ApplicationUser")
.WithMany() .WithMany("Logins")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
@ -234,24 +232,15 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{ {
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany() .WithMany("Users")
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
b.HasOne("Company.WebApplication1.Models.ApplicationUser") b.HasOne("Company.WebApplication1.Models.ApplicationUser")
.WithMany() .WithMany("Roles")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Company.WebApplication1.Models.ApplicationUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
} }
} }
} }

View File

@ -39,12 +39,6 @@ namespace Company.WebApplication1.Data.Migrations
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
@ -169,8 +163,7 @@ namespace Company.WebApplication1.Data.Migrations
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "RoleNameIndex", name: "RoleNameIndex",
table: "AspNetRoles", table: "AspNetRoles",
column: "NormalizedName", column: "NormalizedName");
unique: true);
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId", name: "IX_AspNetRoleClaims_RoleId",
@ -192,6 +185,11 @@ namespace Company.WebApplication1.Data.Migrations
table: "AspNetUserRoles", table: "AspNetUserRoles",
column: "RoleId"); column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_UserId",
table: "AspNetUserRoles",
column: "UserId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "EmailIndex", name: "EmailIndex",
table: "AspNetUsers", table: "AspNetUsers",