Browse Source

refactor Blog module

pull/3432/head
Alper Ebicoglu 7 years ago
parent
commit
e52b3a48e5
  1. 926
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200402110128_Added_Post_Description.Designer.cs
  2. 138
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200402110128_Added_Post_Description.cs
  3. 433
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
  4. 5
      modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj
  5. 3
      modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostConsts.cs
  6. 7
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml
  7. 6
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs
  8. 10
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml
  9. 6
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs
  10. 29
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js
  11. 37
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js

926
modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200402110128_Added_Post_Description.Designer.cs

@ -0,0 +1,926 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.BloggingTestApp.EntityFrameworkCore;
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
[DbContext(typeof(BloggingTestAppDbContext))]
[Migration("20200402110128_Added_Post_Description")]
partial class Added_Post_Description
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Description")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Regex")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault")
.HasColumnType("bit");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic")
.HasColumnType("bit");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("NormalizedName");
b.ToTable("AbpRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AbpRoleClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount")
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("Name")
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnName("NormalizedUserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnName("SecurityStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("NormalizedEmail");
b.HasIndex("NormalizedUserName");
b.HasIndex("UserName");
b.ToTable("AbpUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType")
.IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AbpUserClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("nvarchar(196)")
.HasMaxLength(196);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
b.ToTable("AbpUserLogins");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
b.ToTable("AbpUserRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("Name")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AbpUserTokens");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasColumnType("nvarchar(2048)")
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ShortName")
.IsRequired()
.HasColumnName("ShortName")
.HasColumnType("nvarchar(32)")
.HasMaxLength(32);
b.HasKey("Id");
b.ToTable("BlgBlogs");
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("PostId")
.HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("RepliedCommentId")
.HasColumnName("RepliedCommentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Text")
.IsRequired()
.HasColumnName("Text")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024);
b.HasKey("Id");
b.HasIndex("PostId");
b.HasIndex("RepliedCommentId");
b.ToTable("BlgComments");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId")
.HasColumnName("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Content")
.HasColumnName("Content")
.HasColumnType("nvarchar(max)")
.HasMaxLength(1048576);
b.Property<string>("CoverImage")
.IsRequired()
.HasColumnName("CoverImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1000)")
.HasMaxLength(1000);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ReadCount")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("Url")
.IsRequired()
.HasColumnName("Url")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("BlogId");
b.ToTable("BlgPosts");
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.Property<Guid>("PostId")
.HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("TagId")
.HasColumnName("TagId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.HasKey("PostId", "TagId");
b.HasIndex("TagId");
b.ToTable("BlgPostTags");
});
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<int>("UsageCount")
.HasColumnName("UsageCount")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("BlgTags");
});
modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.HasKey("Id");
b.ToTable("BlgUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany()
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Comments.Comment", null)
.WithMany()
.HasForeignKey("RepliedCommentId");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.HasOne("Volo.Blogging.Blogs.Blog", null)
.WithMany()
.HasForeignKey("BlogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany("Tags")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Tagging.Tag", null)
.WithMany()
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

138
modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20200402110128_Added_Post_Description.cs

@ -0,0 +1,138 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
public partial class Added_Post_Description : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "BlgUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "BlgPosts",
maxLength: 1000,
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedEmail",
table: "AbpUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "IsDeleted",
table: "AbpUsers",
nullable: false,
defaultValue: false,
oldClrType: typeof(bool));
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "AbpUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "ConcurrencyStamp",
table: "AbpClaimTypes",
maxLength: 256,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<string>(
name: "ExtraProperties",
table: "AbpClaimTypes",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Description",
table: "BlgPosts");
migrationBuilder.DropColumn(
name: "ConcurrencyStamp",
table: "AbpClaimTypes");
migrationBuilder.DropColumn(
name: "ExtraProperties",
table: "AbpClaimTypes");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "BlgUsers",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "NormalizedEmail",
table: "AbpUsers",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<bool>(
name: "IsDeleted",
table: "AbpUsers",
nullable: false,
oldClrType: typeof(bool),
oldDefaultValue: false);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "AbpUsers",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpUsers",
maxLength: 256,
nullable: false,
oldClrType: typeof(string),
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AbpRoles",
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 256);
}
}
}

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

@ -15,33 +15,52 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846") .HasAnnotation("ProductVersion", "3.1.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<bool>("IsStatic"); b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("Regex") b.Property<string>("Regex")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512); .HasMaxLength(512);
b.Property<string>("RegexDescription") b.Property<string>("RegexDescription")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128); .HasMaxLength(128);
b.Property<bool>("Required"); b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<int>("ValueType"); b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -51,31 +70,45 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp"); b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256);
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDefault") b.Property<bool>("IsDefault")
.HasColumnName("IsDefault"); .HasColumnName("IsDefault")
.HasColumnType("bit");
b.Property<bool>("IsPublic") b.Property<bool>("IsPublic")
.HasColumnName("IsPublic"); .HasColumnName("IsPublic")
.HasColumnType("bit");
b.Property<bool>("IsStatic") b.Property<bool>("IsStatic")
.HasColumnName("IsStatic"); .HasColumnName("IsStatic")
.HasColumnType("bit");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("NormalizedName") b.Property<string>("NormalizedName")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
@ -87,18 +120,23 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024); .HasMaxLength(1024);
b.Property<Guid>("RoleId"); b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
@ -110,97 +148,133 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<int>("AccessFailedCount") b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount") .HasColumnName("AccessFailedCount")
.HasColumnType("int")
.HasDefaultValue(0); .HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsRequired() .IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp") .HasColumnName("ConcurrencyStamp")
.HasMaxLength(256); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime"); b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId"); b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId"); b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime"); b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Email") b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email") .HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<bool>("EmailConfirmed") b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed") .HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted"); b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime"); b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId"); b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("LockoutEnabled") b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled") .HasColumnName("LockoutEnabled")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnName("Name") .HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("NormalizedEmail") b.Property<string>("NormalizedEmail")
.IsRequired()
.HasColumnName("NormalizedEmail") .HasColumnName("NormalizedEmail")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("NormalizedUserName") b.Property<string>("NormalizedUserName")
.IsRequired() .IsRequired()
.HasColumnName("NormalizedUserName") .HasColumnName("NormalizedUserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("PasswordHash") b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash") .HasColumnName("PasswordHash")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("PhoneNumber") b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber") .HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16); .HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed") b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed") .HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<string>("SecurityStamp") b.Property<string>("SecurityStamp")
.IsRequired() .IsRequired()
.HasColumnName("SecurityStamp") .HasColumnName("SecurityStamp")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("Surname") b.Property<string>("Surname")
.HasColumnName("Surname") .HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnName("TenantId"); .HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("TwoFactorEnabled") b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled") .HasColumnName("TwoFactorEnabled")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<string>("UserName") b.Property<string>("UserName")
.IsRequired() .IsRequired()
.HasColumnName("UserName") .HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.HasKey("Id"); b.HasKey("Id");
@ -219,18 +293,23 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .HasColumnType("uniqueidentifier");
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024); .HasMaxLength(1024);
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("UserId"); b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
@ -241,19 +320,25 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{ {
b.Property<Guid>("UserId"); b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128); .HasMaxLength(128);
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(196)")
.HasMaxLength(196); .HasMaxLength(196);
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "LoginProvider"); b.HasKey("UserId", "LoginProvider");
@ -264,11 +349,15 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{ {
b.Property<Guid>("UserId"); b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("RoleId"); b.Property<Guid>("RoleId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
@ -279,17 +368,23 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{ {
b.Property<Guid>("UserId"); b.Property<Guid>("UserId")
.HasColumnType("uniqueidentifier");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnType("nvarchar(128)")
.HasMaxLength(128); .HasMaxLength(128);
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Value"); b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name"); b.HasKey("UserId", "LoginProvider", "Name");
@ -299,21 +394,27 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128); .HasMaxLength(128);
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("ProviderName") b.Property<string>("ProviderName")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<Guid?>("TenantId"); b.Property<Guid?>("TenantId")
.HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id"); b.HasKey("Id");
@ -325,20 +426,25 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(128)")
.HasMaxLength(128); .HasMaxLength(128);
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("ProviderName") b.Property<string>("ProviderName")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(2048)")
.HasMaxLength(2048); .HasMaxLength(2048);
b.HasKey("Id"); b.HasKey("Id");
@ -351,48 +457,63 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b => modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp"); b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime"); .HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId") b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId"); .HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime") b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnName("Description") .HasColumnName("Description")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024); .HasMaxLength(1024);
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("IsDeleted") .HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId") b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnName("Name") .HasColumnName("Name")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<string>("ShortName") b.Property<string>("ShortName")
.IsRequired() .IsRequired()
.HasColumnName("ShortName") .HasColumnName("ShortName")
.HasColumnType("nvarchar(32)")
.HasMaxLength(32); .HasMaxLength(32);
b.HasKey("Id"); b.HasKey("Id");
@ -403,45 +524,60 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp"); b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime"); .HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId") b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId"); .HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime") b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("IsDeleted") .HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId") b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("PostId") b.Property<Guid>("PostId")
.HasColumnName("PostId"); .HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("RepliedCommentId") b.Property<Guid?>("RepliedCommentId")
.HasColumnName("RepliedCommentId"); .HasColumnName("RepliedCommentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Text") b.Property<string>("Text")
.IsRequired() .IsRequired()
.HasColumnName("Text") .HasColumnName("Text")
.HasColumnType("nvarchar(1024)")
.HasMaxLength(1024); .HasMaxLength(1024);
b.HasKey("Id"); b.HasKey("Id");
@ -456,57 +592,80 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Posts.Post", b => modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId") b.Property<Guid>("BlogId")
.HasColumnName("BlogId"); .HasColumnName("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp"); b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Content") b.Property<string>("Content")
.HasColumnName("Content") .HasColumnName("Content")
.HasColumnType("nvarchar(max)")
.HasMaxLength(1048576); .HasMaxLength(1048576);
b.Property<string>("CoverImage") b.Property<string>("CoverImage")
.IsRequired() .IsRequired()
.HasColumnName("CoverImage"); .HasColumnName("CoverImage")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime"); .HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId") b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId"); .HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime") b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description")
.HasColumnName("Description")
.HasColumnType("nvarchar(1000)")
.HasMaxLength(1000);
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("IsDeleted") .HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId") b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<int>("ReadCount"); b.Property<int>("ReadCount")
.HasColumnType("int");
b.Property<string>("Title") b.Property<string>("Title")
.IsRequired() .IsRequired()
.HasColumnName("Title") .HasColumnName("Title")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512); .HasMaxLength(512);
b.Property<string>("Url") b.Property<string>("Url")
.IsRequired() .IsRequired()
.HasColumnName("Url") .HasColumnName("Url")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.HasKey("Id"); b.HasKey("Id");
@ -519,14 +678,20 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{ {
b.Property<Guid>("PostId") b.Property<Guid>("PostId")
.HasColumnName("PostId"); .HasColumnName("PostId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("TagId") b.Property<Guid>("TagId")
.HasColumnName("TagId"); .HasColumnName("TagId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime"); b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId"); b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.HasKey("PostId", "TagId"); b.HasKey("PostId", "TagId");
@ -538,49 +703,65 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b => modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BlogId"); b.Property<Guid>("BlogId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp"); b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime"); .HasColumnName("CreationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("CreatorId") b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId"); .HasColumnName("CreatorId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId") b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId"); .HasColumnName("DeleterId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime?>("DeletionTime") b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasColumnName("Description") .HasColumnName("Description")
.HasColumnType("nvarchar(512)")
.HasMaxLength(512); .HasMaxLength(512);
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted") b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("IsDeleted") .HasColumnName("IsDeleted")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime") b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime"); .HasColumnName("LastModificationTime")
.HasColumnType("datetime2");
b.Property<Guid?>("LastModifierId") b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId"); .HasColumnName("LastModifierId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnName("Name") .HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<int>("UsageCount") b.Property<int>("UsageCount")
.HasColumnName("UsageCount"); .HasColumnName("UsageCount")
.HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
@ -590,45 +771,59 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b => modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp"); b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("Email") b.Property<string>("Email")
.IsRequired()
.HasColumnName("Email") .HasColumnName("Email")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.Property<bool>("EmailConfirmed") b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed") .HasColumnName("EmailConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name") b.Property<string>("Name")
.HasColumnName("Name") .HasColumnName("Name")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<string>("PhoneNumber") b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber") .HasColumnName("PhoneNumber")
.HasColumnType("nvarchar(16)")
.HasMaxLength(16); .HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed") b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed") .HasColumnName("PhoneNumberConfirmed")
.HasColumnType("bit")
.HasDefaultValue(false); .HasDefaultValue(false);
b.Property<string>("Surname") b.Property<string>("Surname")
.HasColumnName("Surname") .HasColumnName("Surname")
.HasColumnType("nvarchar(64)")
.HasMaxLength(64); .HasMaxLength(64);
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnName("TenantId"); .HasColumnName("TenantId")
.HasColumnType("uniqueidentifier");
b.Property<string>("UserName") b.Property<string>("UserName")
.IsRequired() .IsRequired()
.HasColumnName("UserName") .HasColumnName("UserName")
.HasColumnType("nvarchar(256)")
.HasMaxLength(256); .HasMaxLength(256);
b.HasKey("Id"); b.HasKey("Id");
@ -638,80 +833,90 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{ {
b.HasOne("Volo.Abp.Identity.IdentityRole") b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany("Claims") .WithMany("Claims")
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{ {
b.HasOne("Volo.Abp.Identity.IdentityUser") b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Claims") .WithMany("Claims")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{ {
b.HasOne("Volo.Abp.Identity.IdentityUser") b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Logins") .WithMany("Logins")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{ {
b.HasOne("Volo.Abp.Identity.IdentityRole") b.HasOne("Volo.Abp.Identity.IdentityRole", null)
.WithMany() .WithMany()
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Abp.Identity.IdentityUser") b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Roles") .WithMany("Roles")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{ {
b.HasOne("Volo.Abp.Identity.IdentityUser") b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Tokens") .WithMany("Tokens")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{ {
b.HasOne("Volo.Blogging.Posts.Post") b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany() .WithMany()
.HasForeignKey("PostId") .HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Comments.Comment") b.HasOne("Volo.Blogging.Comments.Comment", null)
.WithMany() .WithMany()
.HasForeignKey("RepliedCommentId"); .HasForeignKey("RepliedCommentId");
}); });
modelBuilder.Entity("Volo.Blogging.Posts.Post", b => modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{ {
b.HasOne("Volo.Blogging.Blogs.Blog") b.HasOne("Volo.Blogging.Blogs.Blog", null)
.WithMany() .WithMany()
.HasForeignKey("BlogId") .HasForeignKey("BlogId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{ {
b.HasOne("Volo.Blogging.Posts.Post") b.HasOne("Volo.Blogging.Posts.Post", null)
.WithMany("Tags") .WithMany("Tags")
.HasForeignKey("PostId") .HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Volo.Blogging.Tagging.Tag") b.HasOne("Volo.Blogging.Tagging.Tag", null)
.WithMany() .WithMany()
.HasForeignKey("TagId") .HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade)
.IsRequired();
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }

5
modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj

@ -4,6 +4,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -17,8 +18,8 @@
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.2"/> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2"/> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.2" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

3
modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/PostConsts.cs

@ -10,5 +10,8 @@
public const int MaxDescriptionLength = 1000; public const int MaxDescriptionLength = 1000;
public const int MaxTitleLengthToBeSeoFriendly = 60;
public const int MaxSeoFriendlyDescriptionLength = 200;
} }
} }

7
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml

@ -1,6 +1,7 @@
@page @page
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor
@using Volo.Blogging.Pages.Blog.Posts @using Volo.Blogging.Pages.Blog.Posts
@using Volo.Blogging.Posts
@model EditModel @model EditModel
@inherits Volo.Blogging.Pages.Blog.BloggingPage @inherits Volo.Blogging.Pages.Blog.BloggingPage
@{ @{
@ -27,7 +28,11 @@
<form method="post" id="edit-post-form"> <form method="post" id="edit-post-form">
<abp-input asp-for="Post.Title" auto-focus="true" /> <abp-input asp-for="Post.Title" auto-focus="true" />
<abp-alert dismissible="true" style="display: none" id="title-length-warning"> <abp-alert
dismissible="true"
style="display: none"
id="title-length-warning"
data-max-length="@PostConsts.MaxTitleLengthToBeSeoFriendly">
@L["TitleLengthWarning"] @L["TitleLengthWarning"]
</abp-alert> </abp-alert>

6
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Edit.cshtml.cs

@ -42,7 +42,7 @@ namespace Volo.Blogging.Pages.Blog.Posts
var postDto = await _postAppService.GetAsync(new Guid(PostId)); var postDto = await _postAppService.GetAsync(new Guid(PostId));
Post = ObjectMapper.Map<PostWithDetailsDto, EditPostViewModel>(postDto); Post = ObjectMapper.Map<PostWithDetailsDto, EditPostViewModel>(postDto);
Post.Tags = String.Join(", ", postDto.Tags.Select(p=>p.Name).ToArray()); Post.Tags = String.Join(", ", postDto.Tags.Select(p => p.Name).ToArray());
return Page(); return Page();
} }
@ -57,7 +57,9 @@ namespace Volo.Blogging.Pages.Blog.Posts
CoverImage = Post.CoverImage, CoverImage = Post.CoverImage,
Content = Post.Content, Content = Post.Content,
Tags = Post.Tags, Tags = Post.Tags,
Description = !Post.Description.IsNullOrWhiteSpace() ? Post.Description : Post.Content.Substring(0,200) Description = Post.Description.IsNullOrEmpty() ?
Post.Content.Truncate(PostConsts.MaxSeoFriendlyDescriptionLength) :
Post.Description
}; };
var editedPost = await _postAppService.UpdateAsync(Post.Id, post); var editedPost = await _postAppService.UpdateAsync(Post.Id, post);

10
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml

@ -1,6 +1,7 @@
@page @page
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor
@using Volo.Blogging.Pages.Blog.Posts @using Volo.Blogging.Pages.Blog.Posts
@using Volo.Blogging.Posts
@model NewModel @model NewModel
@inherits Volo.Blogging.Pages.Blog.BloggingPage @inherits Volo.Blogging.Pages.Blog.BloggingPage
@{ @{
@ -27,8 +28,11 @@
<form method="post" id="new-post-form"> <form method="post" id="new-post-form">
<abp-input asp-for="Post.BlogId" /> <abp-input asp-for="Post.BlogId" />
<abp-input asp-for="Post.Title" auto-focus="true" /> <abp-input asp-for="Post.Title" auto-focus="true" />
<abp-alert dismissible="true" style="display: none" id="title-length-warning"> <abp-alert dismissible="true"
style="display: none"
id="title-length-warning"
data-max-length="@PostConsts.MaxTitleLengthToBeSeoFriendly">
@L["TitleLengthWarning"] @L["TitleLengthWarning"]
</abp-alert> </abp-alert>
@ -78,7 +82,7 @@
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

6
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/New.cshtml.cs

@ -55,12 +55,12 @@ namespace Volo.Blogging.Pages.Blog.Posts
{ {
var blog = await _blogAppService.GetAsync(Post.BlogId); var blog = await _blogAppService.GetAsync(Post.BlogId);
if (Post.Description == null) if (string.IsNullOrEmpty(Post.Description))
{ {
Post.Description = Post.Content.Substring(0, 200); Post.Description = Post.Content.Truncate(PostConsts.MaxSeoFriendlyDescriptionLength);
} }
var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map<CreatePostViewModel,CreatePostDto>(Post)); var postWithDetailsDto = await _postAppService.CreateAsync(ObjectMapper.Map<CreatePostViewModel, CreatePostDto>(Post));
//TODO: Try Url.Page(...) //TODO: Try Url.Page(...)
var urlPrefix = _blogOptions.RoutePrefix; var urlPrefix = _blogOptions.RoutePrefix;

29
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/edit.js

@ -5,11 +5,18 @@
var $submitButton = $container.find("button[type=submit]"); var $submitButton = $container.find("button[type=submit]");
var $form = $container.find("form#edit-post-form"); var $form = $container.find("form#edit-post-form");
var editorDataKey = "tuiEditor"; var editorDataKey = "tuiEditor";
var maxTitleLength = 60; var $titleLengthWarning = $("#title-length-warning");
var maxTitleLength = parseInt($titleLengthWarning.data("max-length"));
var $title = $('#Post_Title');
var $coverImage = $("#CoverImage");
var $postCoverImage = $('#Post_CoverImage');
var $coverImageFile = $('#CoverImageFile');
var setCoverImage = function (file) { var setCoverImage = function (file) {
$('#Post_CoverImage').val(file.fileUrl); $postCoverImage.val(file.fileUrl);
$("#CoverImage").attr("src", file.fileUrl); $coverImage.attr("src", file.fileUrl);
}; };
var uploadCoverImage = function (file) { var uploadCoverImage = function (file) {
@ -29,26 +36,27 @@
}; };
var checkTitleLength = function () { var checkTitleLength = function () {
var title = $('#Post_Title').val(); var title = $title.val();
if (title.length > maxTitleLength) { if (title.length > maxTitleLength) {
$("#title-length-warning").css("display", "block"); $titleLengthWarning.show();
} else { } else {
$("#title-length-warning").css("display", "none"); $titleLengthWarning.hide();
} }
}; };
checkTitleLength(); checkTitleLength();
$('#Post_Title').on("change paste keyup", function () { $title.on("change paste keyup", function () {
checkTitleLength(); checkTitleLength();
}); });
$('#CoverImageFile').change(function () { $coverImageFile.change(function () {
if (!$('#CoverImageFile').prop('files').length) { if (!$coverImageFile.prop('files').length) {
return; return;
} }
var file = $('#CoverImageFile').prop('files')[0];
var file = $coverImageFile.prop('files')[0];
uploadCoverImage(file); uploadCoverImage(file);
}); });
@ -110,6 +118,7 @@
$submitButton.buttonBusy(); $submitButton.buttonBusy();
$(this).off('submit').submit(); $(this).off('submit').submit();
return true;
}); });
}); });

37
modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/new.js

@ -5,12 +5,18 @@
var $submitButton = $container.find("button[type=submit]"); var $submitButton = $container.find("button[type=submit]");
var $form = $container.find("form#new-post-form"); var $form = $container.find("form#new-post-form");
var editorDataKey = "tuiEditor"; var editorDataKey = "tuiEditor";
var maxTitleLength = 60; var $titleLengthWarning = $("#title-length-warning");
var maxTitleLength = parseInt($titleLengthWarning.data("max-length"));
var $title = $('#Post_Title');
var $url = $('#Post_Url');
var $coverImage = $("#CoverImage");
var $postCoverImage = $('#Post_CoverImage');
var $coverImageFile = $('#CoverImageFile');
var setCoverImage = function (file) { var setCoverImage = function (file) {
$('#Post_CoverImage').val(file.fileUrl); $postCoverImage.val(file.fileUrl);
$("#CoverImage").attr("src", file.fileUrl); $coverImage.attr("src", file.fileUrl);
$("#CoverImage").show(); $coverImage.show();
}; };
var uploadCoverImage = function (file) { var uploadCoverImage = function (file) {
@ -29,11 +35,11 @@
}); });
}; };
$('#CoverImageFile').change(function () { $coverImageFile.change(function () {
if (!$('#CoverImageFile').prop('files').length) { if (!$coverImageFile.prop('files').length) {
return; return;
} }
var file = $('#CoverImageFile').prop('files')[0]; var file = $coverImageFile.prop('files')[0];
uploadCoverImage(file); uploadCoverImage(file);
}); });
@ -41,7 +47,7 @@
var formData = new FormData(); var formData = new FormData();
formData.append('file', file); formData.append('file', file);
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/api/blogging/files/images/upload", url: "/api/blogging/files/images/upload",
data: formData, data: formData,
@ -93,35 +99,36 @@
$submitButton.buttonBusy(); $submitButton.buttonBusy();
$(this).off('submit').submit(); $(this).off('submit').submit();
return true;
}); });
var urlEdited = false; var urlEdited = false;
var reflectedChange = false; var reflectedChange = false;
$('#Post_Title').on("change paste keyup", function () { $title.on("change paste keyup", function () {
if (urlEdited) { if (urlEdited) {
return; return;
} }
var title = $('#Post_Title').val(); var title = $title.val();
if (title.length > maxTitleLength) { if (title.length > maxTitleLength) {
$("#title-length-warning").css("display", "block"); $titleLengthWarning.show();
} else { } else {
$("#title-length-warning").css("display", "none"); $titleLengthWarning.hide();
} }
title = title.replace(' ', '-'); title = title.replace(' ', '-');
title = title.replace(new RegExp(' ', 'g'), '-'); title = title.replace(new RegExp(' ', 'g'), '-');
reflectedChange = true; reflectedChange = true;
$('#Post_Url').val(title); $url.val(title);
reflectedChange = false; reflectedChange = false;
}); });
$('#Post_Url').change(function () { $url.change(function () {
if (!reflectedChange) { if (!reflectedChange) {
urlEdited = true; urlEdited = true;
} }
}); });
}); });
Loading…
Cancel
Save