mirror of https://github.com/abpframework/abp.git
43 changed files with 12625 additions and 134 deletions
@ -0,0 +1,582 @@ |
|||||
|
// <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("20180906065034_Added_ReadCount_To_Post")] |
||||
|
partial class Added_ReadCount_To_Post |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846") |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128) |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("NormalizedName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("NormalizedName"); |
||||
|
|
||||
|
b.ToTable("AbpRoles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("ClaimType") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("ClaimValue") |
||||
|
.HasMaxLength(1024); |
||||
|
|
||||
|
b.Property<Guid>("RoleId"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("RoleId"); |
||||
|
|
||||
|
b.ToTable("AbpRoleClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<int>("AccessFailedCount") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("AccessFailedCount") |
||||
|
.HasDefaultValue(0); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("ConcurrencyStamp") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("Email") |
||||
|
.HasColumnName("Email") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<bool>("EmailConfirmed") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("EmailConfirmed") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<bool>("LockoutEnabled") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("LockoutEnabled") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<DateTimeOffset?>("LockoutEnd"); |
||||
|
|
||||
|
b.Property<string>("NormalizedEmail") |
||||
|
.HasColumnName("NormalizedEmail") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("NormalizedUserName") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("NormalizedUserName") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("PasswordHash") |
||||
|
.HasColumnName("PasswordHash") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("PhoneNumber") |
||||
|
.HasColumnName("PhoneNumber") |
||||
|
.HasMaxLength(16); |
||||
|
|
||||
|
b.Property<bool>("PhoneNumberConfirmed") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("PhoneNumberConfirmed") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<string>("SecurityStamp") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("SecurityStamp") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnName("TenantId"); |
||||
|
|
||||
|
b.Property<bool>("TwoFactorEnabled") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("TwoFactorEnabled") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<string>("UserName") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("UserName") |
||||
|
.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") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("ClaimType") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("ClaimValue") |
||||
|
.HasMaxLength(1024); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.Property<Guid>("UserId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("UserId"); |
||||
|
|
||||
|
b.ToTable("AbpUserClaims"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => |
||||
|
{ |
||||
|
b.Property<Guid>("UserId"); |
||||
|
|
||||
|
b.Property<string>("LoginProvider") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderDisplayName") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(196); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("UserId", "LoginProvider"); |
||||
|
|
||||
|
b.HasIndex("LoginProvider", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpUserLogins"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => |
||||
|
{ |
||||
|
b.Property<Guid>("UserId"); |
||||
|
|
||||
|
b.Property<Guid>("RoleId"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("UserId", "RoleId"); |
||||
|
|
||||
|
b.HasIndex("RoleId", "UserId"); |
||||
|
|
||||
|
b.ToTable("AbpUserRoles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => |
||||
|
{ |
||||
|
b.Property<Guid>("UserId"); |
||||
|
|
||||
|
b.Property<string>("LoginProvider") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("Name"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.Property<string>("Value"); |
||||
|
|
||||
|
b.HasKey("UserId", "LoginProvider", "Name"); |
||||
|
|
||||
|
b.ToTable("AbpUserTokens"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpPermissionGrants"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.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(); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasColumnName("Description") |
||||
|
.HasMaxLength(1024); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("IsDeleted") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("Name") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("ShortName") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("ShortName") |
||||
|
.HasMaxLength(32); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("BlgBlogs"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("IsDeleted") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("PostId") |
||||
|
.HasColumnName("PostId"); |
||||
|
|
||||
|
b.Property<Guid?>("RepliedCommentId") |
||||
|
.HasColumnName("RepliedCommentId"); |
||||
|
|
||||
|
b.Property<string>("Text") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("Text") |
||||
|
.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(); |
||||
|
|
||||
|
b.Property<Guid>("BlogId") |
||||
|
.HasColumnName("BlogId"); |
||||
|
|
||||
|
b.Property<string>("Content") |
||||
|
.HasColumnName("Content") |
||||
|
.HasMaxLength(1048576); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("IsDeleted") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<int>("ReadCount"); |
||||
|
|
||||
|
b.Property<string>("Title") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("Title") |
||||
|
.HasMaxLength(512); |
||||
|
|
||||
|
b.Property<string>("Url") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("Url") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("BlogId"); |
||||
|
|
||||
|
b.ToTable("BlgPosts"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => |
||||
|
{ |
||||
|
b.Property<Guid>("PostId") |
||||
|
.HasColumnName("PostId"); |
||||
|
|
||||
|
b.Property<Guid>("TagId") |
||||
|
.HasColumnName("TagId"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId"); |
||||
|
|
||||
|
b.HasKey("PostId", "TagId"); |
||||
|
|
||||
|
b.HasIndex("TagId"); |
||||
|
|
||||
|
b.ToTable("BlgPostTags"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnName("DeleterId"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnName("DeletionTime"); |
||||
|
|
||||
|
b.Property<string>("Description") |
||||
|
.HasColumnName("Description") |
||||
|
.HasMaxLength(512); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("IsDeleted") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("Name") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<int>("UsageCount") |
||||
|
.HasColumnName("UsageCount"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("BlgTags"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.Identity.IdentityRole") |
||||
|
.WithMany("Claims") |
||||
|
.HasForeignKey("RoleId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.Identity.IdentityUser") |
||||
|
.WithMany("Claims") |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.Identity.IdentityUser") |
||||
|
.WithMany("Logins") |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.Identity.IdentityRole") |
||||
|
.WithMany() |
||||
|
.HasForeignKey("RoleId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
|
||||
|
b.HasOne("Volo.Abp.Identity.IdentityUser") |
||||
|
.WithMany("Roles") |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.Identity.IdentityUser") |
||||
|
.WithMany("Tokens") |
||||
|
.HasForeignKey("UserId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Blogging.Posts.Post") |
||||
|
.WithMany() |
||||
|
.HasForeignKey("PostId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
|
||||
|
b.HasOne("Volo.Blogging.Comments.Comment") |
||||
|
.WithMany() |
||||
|
.HasForeignKey("RepliedCommentId"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Blogging.Posts.Post", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Blogging.Blogs.Blog") |
||||
|
.WithMany() |
||||
|
.HasForeignKey("BlogId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Blogging.Posts.Post") |
||||
|
.WithMany("Tags") |
||||
|
.HasForeignKey("PostId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
|
||||
|
b.HasOne("Volo.Blogging.Tagging.Tag") |
||||
|
.WithMany() |
||||
|
.HasForeignKey("TagId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
public partial class Added_ReadCount_To_Post : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AddColumn<int>( |
||||
|
name: "ReadCount", |
||||
|
table: "BlgPosts", |
||||
|
nullable: false, |
||||
|
defaultValue: 0); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "ReadCount", |
||||
|
table: "BlgPosts"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,33 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Microsoft.Extensions.Localization; |
||||
|
using Volo.Abp.UI.Navigation; |
||||
|
using Volo.Blogging.Localization; |
||||
|
|
||||
|
namespace Volo.Blogging |
||||
|
{ |
||||
|
public class BloggingMenuContributor : IMenuContributor |
||||
|
{ |
||||
|
public async Task ConfigureMenuAsync(MenuConfigurationContext context) |
||||
|
{ |
||||
|
if (context.Menu.Name == StandardMenus.Main) |
||||
|
{ |
||||
|
await ConfigureMainMenu(context); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private async Task ConfigureMainMenu(MenuConfigurationContext context) |
||||
|
{ |
||||
|
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>(); |
||||
|
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<BloggingResource>>(); |
||||
|
|
||||
|
if (await authorizationService.IsGrantedAsync(BloggingPermissions.Blogs.Default)) |
||||
|
{ |
||||
|
var rootMenuItem = new ApplicationMenuItem("Blogs", l["Menu:Blogs"], "/Blog"); |
||||
|
|
||||
|
context.Menu.AddItem(rootMenuItem); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,15 +1,20 @@ |
|||||
{ |
{ |
||||
"culture": "tr", |
"culture": "tr", |
||||
"texts": { |
"texts": { |
||||
|
"Menu:Blogs": "Blog", |
||||
"Title": "Başlık", |
"Title": "Başlık", |
||||
"ContinueReading": "Okumaya Devam", |
"ContinueReading": "Devamı...", |
||||
"DaysAgo": "Gün Önce", |
"DaysAgo": "Gün Önce", |
||||
"Content": "İçerik", |
"Content": "İçerik", |
||||
"SeeAll": "Hepsini Gör", |
"SeeAll": "Hepsini Gör", |
||||
"PopularTags": "Popüler Etiketler", |
"PopularTags": "Popüler Etiketler", |
||||
"Read": "Okunma", |
"Read": "Okunma", |
||||
"LastPosts": "Son Yazılar", |
"LastPosts": "Son Yazılar", |
||||
|
"LeaveComment": "Yorum Bırak", |
||||
|
"TagsInThisArticle": "Makalenin Etiketleri", |
||||
"Posts": "Yazılar", |
"Posts": "Yazılar", |
||||
"Comment": "Yorum" |
"Edit": "Düzelt", |
||||
|
"Comment": "Yorum", |
||||
|
"WhatIsNew": "Yeniler" |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,93 @@ |
|||||
|
@page |
||||
|
@inherits Volo.Blogging.Pages.Blog.BloggingPage |
||||
|
@using Volo.Blogging.Pages.Blog.Tags |
||||
|
@model PostsModel |
||||
|
@{ |
||||
|
} |
||||
|
|
||||
|
@section scripts { |
||||
|
<abp-script-bundle name="@typeof(PostsModel).FullName"> |
||||
|
<abp-script src="/Pages/Blog/Posts/blogcss/blog.js" /> |
||||
|
</abp-script-bundle> |
||||
|
} |
||||
|
@section styles { |
||||
|
<abp-style-bundle @*name="@typeof(DetailModel).FullName" *@> |
||||
|
<abp-style src="/Pages/Blog/Posts/blogcss/blog.css" /> |
||||
|
</abp-style-bundle> |
||||
|
} |
||||
|
|
||||
|
<div class="container last-post-section pb-5"> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-8"> |
||||
|
<div class="row"> |
||||
|
<div class="col"> |
||||
|
<div class="titline"> |
||||
|
<h2>#@Model.TagName</h2> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
@for (var index = 0; index < Model.Posts.Count; index++) |
||||
|
{ |
||||
|
var post = Model.Posts[index]; |
||||
|
var oddPost = index % 2 == 1; |
||||
|
|
||||
|
<section class="box-articles"> |
||||
|
<div class="row @(oddPost?"align-middle":"")"> |
||||
|
<div class="col-md-4 order-md-@(oddPost?"last":"first")"> |
||||
|
<div class="img-container"> |
||||
|
<a asp-page="/Blog/Posts/Detail" asp-route-postUrl="@post.Url" asp-route-blogShortName="@Model.BlogShortName"> |
||||
|
<img src="https://placeimg.com/480/270/tech" class="box-article-img"> |
||||
|
</a> |
||||
|
<div class="user-link-icons"> |
||||
|
<a class="add-bookmark" href="#"> |
||||
|
<i class="fa fa-bookmark"></i> |
||||
|
</a> |
||||
|
<a class="share-article" href="#"> |
||||
|
<i class="fa fa-share-alt"></i> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-md-8 order-md-@(oddPost?"first":"last")"> |
||||
|
<p class="tags"> |
||||
|
@foreach (var tag in post.Tags) |
||||
|
{ |
||||
|
<a asp-page="/Blog/Tags/Posts" asp-route-blogShortName="@Model.BlogShortName" asp-route-tagName="@tag.Name" class="tag">@tag.Name</a> |
||||
|
} |
||||
|
</p> |
||||
|
<h3> |
||||
|
<a asp-page="/Blog/Posts/Detail" asp-route-postUrl="@post.Url" asp-route-blogShortName="@Model.BlogShortName">@post.Title</a> |
||||
|
</h3> |
||||
|
<p> |
||||
|
@(post.Content == null ? "" : (post.Content.Length > 250 ? post.Content.Substring(0, 150) : post.Content))... |
||||
|
</p> |
||||
|
<div class="article-owner"> |
||||
|
<div class="article-infos"> |
||||
|
<div class="user-card"> |
||||
|
<a href="#"> |
||||
|
<img src="https://placeimg.com/120/120/pople" class="article-avatar"> |
||||
|
</a> |
||||
|
<a href="#"> |
||||
|
<strong>Armağan Ünlü</strong>, @((DateTime.Today - post.CreationTime).Days) @L["DaysAgo"] |
||||
|
</a> |
||||
|
<span class="seperator">|</span> |
||||
|
<a href="#"> |
||||
|
<i class="fa fa-eye"></i> @post.ReadCount |
||||
|
</a> |
||||
|
<span class="seperator">|</span> |
||||
|
<a href="#"> |
||||
|
<i class="fa fa-comment"></i> @post.CommentCount |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
} |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
@ -0,0 +1,34 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.AspNetCore.Mvc.RazorPages; |
||||
|
using Volo.Blogging.Blogs; |
||||
|
using Volo.Blogging.Posts; |
||||
|
|
||||
|
namespace Volo.Blogging.Pages.Blog.Tags |
||||
|
{ |
||||
|
public class PostsModel : PageModel |
||||
|
{ |
||||
|
private readonly IPostAppService _postAppService; |
||||
|
private readonly IBlogAppService _blogAppService; |
||||
|
|
||||
|
[BindProperty(SupportsGet = true)] |
||||
|
public string BlogShortName { get; set; } |
||||
|
|
||||
|
[BindProperty(SupportsGet = true)] |
||||
|
public string TagName { get; set; } |
||||
|
|
||||
|
public IReadOnlyList<PostWithDetailsDto> Posts { get; set; } |
||||
|
|
||||
|
public PostsModel(IPostAppService postAppService, IBlogAppService blogAppService) |
||||
|
{ |
||||
|
_postAppService = postAppService; |
||||
|
_blogAppService = blogAppService; |
||||
|
} |
||||
|
|
||||
|
public async void OnGetAsync() |
||||
|
{ |
||||
|
var blog = await _blogAppService.GetByShortNameAsync(BlogShortName); |
||||
|
Posts = (await _postAppService.GetListByBlogIdAndTagName(blog.Id, TagName)).Items; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue