diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.Designer.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.Designer.cs
new file mode 100644
index 0000000000..19b04bb41c
--- /dev/null
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.Designer.cs
@@ -0,0 +1,128 @@
+//
+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("20180621080811_Added_Blog_And_Post")]
+ partial class Added_Blog_And_Post
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "2.1.0-rtm-30799")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasColumnName("Description")
+ .HasMaxLength(1024);
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnName("Name")
+ .HasMaxLength(256);
+
+ b.Property("ShortName")
+ .IsRequired()
+ .HasColumnName("ShortName")
+ .HasMaxLength(32);
+
+ b.HasKey("Id");
+
+ b.ToTable("BlgBlogs");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("BlogId")
+ .HasColumnName("BlogId");
+
+ b.Property("Content")
+ .HasColumnName("Content")
+ .HasMaxLength(1048576);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnName("Title")
+ .HasMaxLength(512);
+
+ b.HasKey("Id");
+
+ b.HasIndex("BlogId");
+
+ b.ToTable("BlgPosts");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
+ {
+ b.HasOne("Volo.Blogging.Blogs.Blog")
+ .WithMany()
+ .HasForeignKey("BlogId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.cs
new file mode 100644
index 0000000000..240095568e
--- /dev/null
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.cs
@@ -0,0 +1,73 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
+{
+ public partial class Added_Blog_And_Post : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "BlgBlogs",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ IsDeleted = table.Column(nullable: false, defaultValue: false),
+ DeleterId = table.Column(nullable: true),
+ DeletionTime = table.Column(nullable: true),
+ Name = table.Column(maxLength: 256, nullable: false),
+ ShortName = table.Column(maxLength: 32, nullable: false),
+ Description = table.Column(maxLength: 1024, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_BlgBlogs", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "BlgPosts",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ CreationTime = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: true),
+ LastModificationTime = table.Column(nullable: true),
+ LastModifierId = table.Column(nullable: true),
+ IsDeleted = table.Column(nullable: false, defaultValue: false),
+ DeleterId = table.Column(nullable: true),
+ DeletionTime = table.Column(nullable: true),
+ BlogId = table.Column(nullable: false),
+ Title = table.Column(maxLength: 512, nullable: false),
+ Content = table.Column(maxLength: 1048576, nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_BlgPosts", x => x.Id);
+ table.ForeignKey(
+ name: "FK_BlgPosts_BlgBlogs_BlogId",
+ column: x => x.BlogId,
+ principalTable: "BlgBlogs",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_BlgPosts_BlogId",
+ table: "BlgPosts",
+ column: "BlogId");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "BlgPosts");
+
+ migrationBuilder.DropTable(
+ name: "BlgBlogs");
+ }
+ }
+}
diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
new file mode 100644
index 0000000000..78328e5da6
--- /dev/null
+++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
@@ -0,0 +1,126 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.BloggingTestApp.EntityFrameworkCore;
+
+namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
+{
+ [DbContext(typeof(BloggingTestAppDbContext))]
+ partial class BloggingTestAppDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "2.1.0-rtm-30799")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Description")
+ .HasColumnName("Description")
+ .HasMaxLength(1024);
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnName("Name")
+ .HasMaxLength(256);
+
+ b.Property("ShortName")
+ .IsRequired()
+ .HasColumnName("ShortName")
+ .HasMaxLength(32);
+
+ b.HasKey("Id");
+
+ b.ToTable("BlgBlogs");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("BlogId")
+ .HasColumnName("BlogId");
+
+ b.Property("Content")
+ .HasColumnName("Content")
+ .HasMaxLength(1048576);
+
+ b.Property("CreationTime")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnName("DeletionTime");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnName("IsDeleted")
+ .HasDefaultValue(false);
+
+ b.Property("LastModificationTime")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnName("Title")
+ .HasMaxLength(512);
+
+ b.HasKey("Id");
+
+ b.HasIndex("BlogId");
+
+ b.ToTable("BlgPosts");
+ });
+
+ modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
+ {
+ b.HasOne("Volo.Blogging.Blogs.Blog")
+ .WithMany()
+ .HasForeignKey("BlogId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/modules/blogging/docs/features-and-functionality.md b/modules/blogging/docs/features-and-functionality.md
index daabfa68ad..7c91f6c923 100644
--- a/modules/blogging/docs/features-and-functionality.md
+++ b/modules/blogging/docs/features-and-functionality.md
@@ -4,31 +4,32 @@ The blog module takes Medium as a reference for simplicity & features.
### Overall / Ideas
-* Blogging (Full Audited)
+* Blog (Full Audited)
* Name
* Post (Full Audited)
* BloggingId
* Title
* Content
- * Creator
- * Tags
- * View Count
- * Comments (Full Audited)
- * Text
+ * *Tags*
+ * *View Count*
+ * *Comments (Full Audited)*
+ * *Text*
* Editor
* Markdown & WYSIWYG editor
* Supports images, videos and code sections
* Supports preview
* Users
- * Supports gravatar for profile image
+ * *Supports gravatar for profile image*
* Supports Multi-Tenancy
* Theming
* Nicely split views into partials, so we can create templates by overriding some parts.
* ORM/DB
- * Supports EF Core & MongoDB
+ * Supports EF Core & *MongoDB*
### Pages
+* Blog List
+ * Goes to the blog if there is only one
* Post List
* Shows a list of blog post summaries (title & some part from the beginning)
* Supports Paging & Searching
diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/BlogDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/BlogDto.cs
new file mode 100644
index 0000000000..b43c42be70
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/BlogDto.cs
@@ -0,0 +1,14 @@
+using System;
+using Volo.Abp.Application.Dtos;
+
+namespace Volo.Blogging.Blogs
+{
+ public class BlogDto : EntityDto
+ {
+ public string Name { get; set; }
+
+ public string ShortName { get; set; }
+
+ public string Description { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs
new file mode 100644
index 0000000000..502a4364e7
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs
@@ -0,0 +1,11 @@
+namespace Volo.Blogging.Blogs
+{
+ public static class BlogConsts
+ {
+ public const int MaxNameLength = 256;
+
+ public const int MaxShortNameLength = 32;
+
+ public const int MaxDescriptionLength = 1024;
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/BlogConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/BlogConsts.cs
new file mode 100644
index 0000000000..654d611781
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/BlogConsts.cs
@@ -0,0 +1,9 @@
+namespace Volo.Blogging.Posts
+{
+ public static class PostConsts
+ {
+ public const int MaxTitleLength = 512;
+
+ public const int MaxContentLength = 1024 * 1024; //1MB
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingConsts.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingConsts.cs
index 1b9f59392a..21c22bd5d3 100644
--- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingConsts.cs
+++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingConsts.cs
@@ -2,7 +2,7 @@
{
public static class BloggingConsts
{
- public const string DefaultDbTablePrefix = "Blogging";
+ public const string DefaultDbTablePrefix = "Blg";
public const string DefaultDbSchema = null;
}
}
diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs
new file mode 100644
index 0000000000..3a54727d92
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs
@@ -0,0 +1,37 @@
+using System;
+using JetBrains.Annotations;
+using Volo.Abp;
+using Volo.Abp.Domain.Entities.Auditing;
+
+namespace Volo.Blogging.Blogs
+{
+ public class Blog : FullAuditedAggregateRoot
+ {
+ [NotNull]
+ public virtual string Name { get; protected set; }
+
+ [NotNull]
+ public virtual string ShortName { get; protected set; }
+
+ [CanBeNull]
+ public virtual string Description { get; set; }
+
+ protected Blog()
+ {
+
+ }
+
+ public Blog(Guid id, [NotNull] string name, [NotNull] string shortName)
+ {
+ Id = id;
+ Name = Check.NotNullOrWhiteSpace(name, nameof(name));
+ ShortName = Check.NotNullOrWhiteSpace(shortName, nameof(shortName));
+ }
+
+ public virtual Blog SetName([NotNull] string name)
+ {
+ Name = Check.NotNullOrWhiteSpace(name, nameof(name));
+ return this;
+ }
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/Post.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/Post.cs
new file mode 100644
index 0000000000..9faf0593a1
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/Post.cs
@@ -0,0 +1,37 @@
+using System;
+using JetBrains.Annotations;
+using Volo.Abp;
+using Volo.Abp.Domain.Entities.Auditing;
+
+namespace Volo.Blogging.Posts
+{
+ public class Post : FullAuditedAggregateRoot
+ {
+ public virtual Guid BlogId { get; protected set; }
+
+ [NotNull]
+ public virtual string Title { get; protected set; }
+
+ [CanBeNull]
+ public virtual string Content { get; set; }
+
+ protected Post()
+ {
+
+ }
+
+ public Post(Guid id, Guid blogId, Guid creatorId, [NotNull] string title)
+ {
+ Id = id;
+ CreatorId = creatorId;
+ BlogId = blogId;
+ Title = Check.NotNullOrWhiteSpace(title, nameof(title));
+ }
+
+ public virtual Post SetTitle([NotNull] string title)
+ {
+ Title = Check.NotNullOrWhiteSpace(title, nameof(title));
+ return this;
+ }
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs
index 28a41e41cd..905fb4c875 100644
--- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs
+++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs
@@ -1,6 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
+using Volo.Blogging.Blogs;
+using Volo.Blogging.Posts;
namespace Volo.Blogging.EntityFrameworkCore
{
@@ -10,6 +12,10 @@ namespace Volo.Blogging.EntityFrameworkCore
public static string TablePrefix { get; set; } = BloggingConsts.DefaultDbTablePrefix;
public static string Schema { get; set; } = BloggingConsts.DefaultDbSchema;
+ public DbSet Blogs { get; set; }
+
+ public DbSet Posts { get; set; }
+
public BloggingDbContext(DbContextOptions options)
: base(options)
{
diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
index 849c76de35..15644a4cab 100644
--- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
+++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
@@ -2,6 +2,9 @@
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+using Volo.Blogging.Blogs;
+using Volo.Blogging.Posts;
namespace Volo.Blogging.EntityFrameworkCore
{
@@ -15,6 +18,30 @@ namespace Volo.Blogging.EntityFrameworkCore
var options = new BloggingModelBuilderConfigurationOptions();
optionsAction?.Invoke(options);
+
+ builder.Entity(b =>
+ {
+ b.ToTable(options.TablePrefix + "Blogs", options.Schema);
+
+ b.ConfigureFullAudited();
+
+ b.Property(x => x.Name).IsRequired().HasMaxLength(BlogConsts.MaxNameLength).HasColumnName(nameof(Blog.Name));
+ b.Property(x => x.ShortName).IsRequired().HasMaxLength(BlogConsts.MaxShortNameLength).HasColumnName(nameof(Blog.ShortName));
+ b.Property(x => x.Description).IsRequired(false).HasMaxLength(BlogConsts.MaxDescriptionLength).HasColumnName(nameof(Blog.Description));
+ });
+
+ builder.Entity(b =>
+ {
+ b.ToTable(options.TablePrefix + "Posts", options.Schema);
+
+ b.ConfigureFullAudited();
+
+ b.Property(x => x.BlogId).HasColumnName(nameof(Post.BlogId));
+ b.Property(x => x.Title).IsRequired().HasMaxLength(PostConsts.MaxTitleLength).HasColumnName(nameof(Post.Title));
+ b.Property(x => x.Content).IsRequired(false).HasMaxLength(PostConsts.MaxContentLength).HasColumnName(nameof(Post.Content));
+
+ b.HasOne().WithMany().IsRequired().HasForeignKey(p => p.BlogId);
+ });
}
}
}
diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs
index a8d79674c0..b362d8f71d 100644
--- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs
+++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs
@@ -1,11 +1,16 @@
-using Volo.Abp.Data;
+using Microsoft.EntityFrameworkCore;
+using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
+using Volo.Blogging.Blogs;
+using Volo.Blogging.Posts;
namespace Volo.Blogging.EntityFrameworkCore
{
[ConnectionStringName("Blogging")]
public interface IBloggingDbContext : IEfCoreDbContext
{
-
+ DbSet Blogs { get; set; }
+
+ DbSet Posts { get; set; }
}
}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml
index 4275a40101..4d25b36339 100644
--- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml
@@ -1,8 +1,18 @@
@page
@using Volo.Blogging.Pages.Blog
+@*inherits BloggingPage*@
@model IndexModel
@{
}
- Hi, I'm the blog module!
+ Blogs
+
+
+ @foreach (var blog in Model.Blogs)
+ {
+ -
+ @blog.Name
+
+ }
+
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml.cs
index 6f96db1654..4ee5654d65 100644
--- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml.cs
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml.cs
@@ -1,11 +1,26 @@
-using Microsoft.AspNetCore.Mvc.RazorPages;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
+using Volo.Blogging.Blogs;
namespace Volo.Blogging.Pages.Blog
{
- public class IndexModel : PageModel
+ public class IndexModel : AbpPageModel
{
- public void OnGet()
+ public List Blogs { get; private set; }
+
+ public IndexModel()
+ {
+
+ }
+
+ public async Task OnGet()
{
+ Blogs = new List
+ {
+ new BlogDto {Id = Guid.NewGuid(), Name = "abp", ShortName = "abp", Description = "a b p"}
+ };
}
}
}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml
new file mode 100644
index 0000000000..c925b6ad0d
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml
@@ -0,0 +1,5 @@
+@page
+@using Volo.Blogging.Pages.Blog.Posts
+@model DetailModel
+@{
+}
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs
new file mode 100644
index 0000000000..6141a22458
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace Volo.Blogging.Pages.Blog.Posts
+{
+ public class DetailModel : PageModel
+ {
+ public void OnGet()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml
new file mode 100644
index 0000000000..d0765acd07
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml
@@ -0,0 +1,4 @@
+@page
+@model Volo.Blogging.Pages.Blog.Posts.IndexModel
+@{
+}
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs
new file mode 100644
index 0000000000..70481aec54
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace Volo.Blogging.Pages.Blog.Posts
+{
+ public class IndexModel : PageModel
+ {
+ public void OnGet()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/QaPage.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/QaPage.cs
new file mode 100644
index 0000000000..7a07772219
--- /dev/null
+++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/QaPage.cs
@@ -0,0 +1,25 @@
+using Microsoft.AspNetCore.Mvc.Localization;
+using Microsoft.AspNetCore.Mvc.Razor.Internal;
+using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
+using Volo.Blogging.Localization;
+
+namespace Volo.Blogging.Pages.Blog
+{
+ public abstract class BloggingPage : AbpPage
+ {
+ [RazorInject]
+ public IHtmlLocalizer L { get; set; }
+
+ public const string DefaultTitle = "Blog";
+
+ public string GetTitle(string title = null)
+ {
+ if (string.IsNullOrWhiteSpace(title))
+ {
+ return DefaultTitle;
+ }
+
+ return title;
+ }
+ }
+}
diff --git a/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj b/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
index b01b09d337..629c022e8e 100644
--- a/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
+++ b/modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
@@ -19,4 +19,9 @@
+
+
+
+
+