Browse Source

refactor

pull/19418/head
Salih 2 years ago
parent
commit
5631dc36d4
  1. 1562
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20240404113615_SyncMigrations.Designer.cs
  2. 638
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20240404113615_SyncMigrations.cs
  3. 95
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
  4. 23
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml.cs

1562
modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20240404113615_SyncMigrations.Designer.cs

File diff suppressed because it is too large

638
modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20240404113615_SyncMigrations.cs

@ -0,0 +1,638 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
/// <inheritdoc />
public partial class SyncMigrations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Twitter",
table: "BlgUsers",
type: "nvarchar(128)",
maxLength: 128,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Linkedin",
table: "BlgUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "JobTitle",
table: "BlgUsers",
type: "nvarchar(128)",
maxLength: 128,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(32)",
oldMaxLength: 32,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Github",
table: "BlgUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgUsers",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgUsers",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Company",
table: "BlgUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(128)",
oldMaxLength: 128,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgTags",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgTags",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgPosts",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgPosts",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgComments",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgComments",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgBlogs",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgBlogs",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpUsers",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpSecurityLogs",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpSecurityLogs",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpRoles",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpOrganizationUnits",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpOrganizationUnits",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpClaimTypes",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpBlobs",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpBlobs",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpBlobContainers",
type: "nvarchar(max)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpBlobContainers",
type: "nvarchar(40)",
maxLength: 40,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40,
oldNullable: true);
migrationBuilder.CreateTable(
name: "AbpSettingDefinitions",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
DefaultValue = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
IsVisibleToClients = table.Column<bool>(type: "bit", nullable: false),
Providers = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
IsInherited = table.Column<bool>(type: "bit", nullable: false),
IsEncrypted = table.Column<bool>(type: "bit", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AbpSettingDefinitions_Name",
table: "AbpSettingDefinitions",
column: "Name",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpSettingDefinitions");
migrationBuilder.AlterColumn<string>(
name: "Twitter",
table: "BlgUsers",
type: "nvarchar(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(128)",
oldMaxLength: 128,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Linkedin",
table: "BlgUsers",
type: "nvarchar(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "JobTitle",
table: "BlgUsers",
type: "nvarchar(32)",
maxLength: 32,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(128)",
oldMaxLength: 128,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Github",
table: "BlgUsers",
type: "nvarchar(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgUsers",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgUsers",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "Company",
table: "BlgUsers",
type: "nvarchar(128)",
maxLength: 128,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgTags",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgTags",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgPosts",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgPosts",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgComments",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgComments",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "BlgBlogs",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "BlgBlogs",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpUsers",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpSecurityLogs",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpSecurityLogs",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpRoles",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpOrganizationUnits",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpOrganizationUnits",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpClaimTypes",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpBlobs",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpBlobs",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
migrationBuilder.AlterColumn<string>(
name: "ExtraProperties",
table: "AbpBlobContainers",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpBlobContainers",
type: "nvarchar(40)",
maxLength: 40,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(40)",
oldMaxLength: 40);
}
}
}

95
modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "7.0.1")
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@ -32,6 +32,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -44,6 +45,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnType("varbinary(max)");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -73,11 +75,13 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -105,6 +109,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -114,6 +119,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -179,6 +185,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -187,6 +194,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnType("int");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -279,6 +287,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -291,6 +300,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnType("datetime2");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -340,6 +350,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -376,6 +387,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnType("int");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -660,6 +672,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -690,6 +703,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnType("int");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -898,6 +912,55 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.ToTable("AbpSettings", (string)null);
});
modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("DefaultValue")
.HasMaxLength(2048)
.HasColumnType("nvarchar(2048)");
b.Property<string>("Description")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsEncrypted")
.HasColumnType("bit");
b.Property<bool>("IsInherited")
.HasColumnType("bit");
b.Property<bool>("IsVisibleToClients")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Providers")
.HasMaxLength(1024)
.HasColumnType("nvarchar(1024)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("AbpSettingDefinitions", (string)null);
});
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
{
b.Property<Guid>("Id")
@ -906,6 +969,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -932,6 +996,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -974,6 +1039,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -995,6 +1061,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("DeletionTime");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -1047,6 +1114,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -1083,6 +1151,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -1158,6 +1227,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -1184,6 +1254,7 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -1228,12 +1299,13 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("Biography");
b.Property<string>("Company")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("Company");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
@ -1251,12 +1323,13 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("EmailConfirmed");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Github")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("Github");
b.Property<bool>("IsActive")
@ -1264,13 +1337,13 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("IsActive");
b.Property<string>("JobTitle")
.HasMaxLength(32)
.HasColumnType("nvarchar(32)")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("JobTitle");
b.Property<string>("Linkedin")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)")
.HasColumnName("Linkedin");
b.Property<string>("Name")
@ -1299,8 +1372,8 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("TenantId");
b.Property<string>("Twitter")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)")
.HasColumnName("Twitter");
b.Property<string>("UserName")

23
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml.cs

@ -49,16 +49,17 @@ namespace Volo.Blogging.Pages.Blogs.Posts
try
{
Blog = await GetBlogAsync(_blogAppService, BlogOptions, BlogShortName);
if(Blog == null)
{
return BlogNotFoundResult();
}
BlogShortName = Blog.ShortName;
}
catch (EntityNotFoundException)
{
if (BlogOptions.SingleBlogMode.Enabled)
{
return NotFound();
}
return RedirectToPage("/Blogs/Index");
return BlogNotFoundResult();
}
Posts = (await _postAppService.GetListByBlogIdAndTagNameAsync(Blog.Id, TagName)).Items;
@ -66,7 +67,15 @@ namespace Volo.Blogging.Pages.Blogs.Posts
return Page();
}
protected virtual ActionResult BlogNotFoundResult()
{
if (BlogOptions.SingleBlogMode.Enabled)
{
return NotFound();
}
return RedirectToPage("/Blogs/Index");
}
}
}
Loading…
Cancel
Save