Browse Source

Added Blog & Post entities.

pull/318/head
Halil ibrahim Kalkan 8 years ago
parent
commit
5ad18b7ca3
  1. 128
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.Designer.cs
  2. 73
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.cs
  3. 126
      modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs
  4. 17
      modules/blogging/docs/features-and-functionality.md
  5. 14
      modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/BlogDto.cs
  6. 11
      modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs
  7. 9
      modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Posts/BlogConsts.cs
  8. 2
      modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingConsts.cs
  9. 37
      modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs
  10. 37
      modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/Post.cs
  11. 6
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs
  12. 27
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs
  13. 9
      modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs
  14. 12
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml
  15. 21
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml.cs
  16. 5
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml
  17. 16
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml.cs
  18. 4
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml
  19. 16
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml.cs
  20. 25
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/QaPage.cs
  21. 5
      modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj

128
modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180621080811_Added_Blog_And_Post.Designer.cs

@ -0,0 +1,128 @@
// <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("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<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.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<string>("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
}
}
}

73
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<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: false),
ShortName = table.Column<string>(maxLength: 32, nullable: false),
Description = table.Column<string>(maxLength: 1024, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BlgBlogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "BlgPosts",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
BlogId = table.Column<Guid>(nullable: false),
Title = table.Column<string>(maxLength: 512, nullable: false),
Content = table.Column<string>(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");
}
}
}

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

@ -0,0 +1,126 @@
// <auto-generated />
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<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.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<string>("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
}
}
}

17
modules/blogging/docs/features-and-functionality.md

@ -4,31 +4,32 @@ The blog module takes Medium as a reference for simplicity & features.
### Overall / Ideas ### Overall / Ideas
* Blogging (Full Audited) * Blog (Full Audited)
* Name * Name
* Post (Full Audited) * Post (Full Audited)
* BloggingId * BloggingId
* Title * Title
* Content * Content
* Creator * *Tags*
* Tags * *View Count*
* View Count * *Comments (Full Audited)*
* Comments (Full Audited) * *Text*
* Text
* Editor * Editor
* Markdown & WYSIWYG editor * Markdown & WYSIWYG editor
* Supports images, videos and code sections * Supports images, videos and code sections
* Supports preview * Supports preview
* Users * Users
* Supports gravatar for profile image * *Supports gravatar for profile image*
* Supports Multi-Tenancy * Supports Multi-Tenancy
* Theming * Theming
* Nicely split views into partials, so we can create templates by overriding some parts. * Nicely split views into partials, so we can create templates by overriding some parts.
* ORM/DB * ORM/DB
* Supports EF Core & MongoDB * Supports EF Core & *MongoDB*
### Pages ### Pages
* Blog List
* Goes to the blog if there is only one
* Post List * Post List
* Shows a list of blog post summaries (title & some part from the beginning) * Shows a list of blog post summaries (title & some part from the beginning)
* Supports Paging & Searching * Supports Paging & Searching

14
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<Guid>
{
public string Name { get; set; }
public string ShortName { get; set; }
public string Description { get; set; }
}
}

11
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;
}
}

9
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
}
}

2
modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingConsts.cs

@ -2,7 +2,7 @@
{ {
public static class BloggingConsts public static class BloggingConsts
{ {
public const string DefaultDbTablePrefix = "Blogging"; public const string DefaultDbTablePrefix = "Blg";
public const string DefaultDbSchema = null; public const string DefaultDbSchema = null;
} }
} }

37
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<Guid>
{
[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;
}
}
}

37
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<Guid>
{
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;
}
}
}

6
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs

@ -1,6 +1,8 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Blogging.Blogs;
using Volo.Blogging.Posts;
namespace Volo.Blogging.EntityFrameworkCore namespace Volo.Blogging.EntityFrameworkCore
{ {
@ -10,6 +12,10 @@ namespace Volo.Blogging.EntityFrameworkCore
public static string TablePrefix { get; set; } = BloggingConsts.DefaultDbTablePrefix; public static string TablePrefix { get; set; } = BloggingConsts.DefaultDbTablePrefix;
public static string Schema { get; set; } = BloggingConsts.DefaultDbSchema; public static string Schema { get; set; } = BloggingConsts.DefaultDbSchema;
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
public BloggingDbContext(DbContextOptions<BloggingDbContext> options) public BloggingDbContext(DbContextOptions<BloggingDbContext> options)
: base(options) : base(options)
{ {

27
modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs

@ -2,6 +2,9 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Volo.Blogging.Blogs;
using Volo.Blogging.Posts;
namespace Volo.Blogging.EntityFrameworkCore namespace Volo.Blogging.EntityFrameworkCore
{ {
@ -15,6 +18,30 @@ namespace Volo.Blogging.EntityFrameworkCore
var options = new BloggingModelBuilderConfigurationOptions(); var options = new BloggingModelBuilderConfigurationOptions();
optionsAction?.Invoke(options); optionsAction?.Invoke(options);
builder.Entity<Blog>(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<Post>(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<Blog>().WithMany().IsRequired().HasForeignKey(p => p.BlogId);
});
} }
} }
} }

9
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.Abp.EntityFrameworkCore;
using Volo.Blogging.Blogs;
using Volo.Blogging.Posts;
namespace Volo.Blogging.EntityFrameworkCore namespace Volo.Blogging.EntityFrameworkCore
{ {
[ConnectionStringName("Blogging")] [ConnectionStringName("Blogging")]
public interface IBloggingDbContext : IEfCoreDbContext public interface IBloggingDbContext : IEfCoreDbContext
{ {
DbSet<Blog> Blogs { get; set; }
DbSet<Post> Posts { get; set; }
} }
} }

12
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Index.cshtml

@ -1,8 +1,18 @@
@page @page
@using Volo.Blogging.Pages.Blog @using Volo.Blogging.Pages.Blog
@*inherits BloggingPage*@
@model IndexModel @model IndexModel
@{ @{
} }
<h2> <h2>
Hi, I'm the blog module! Blogs
</h2> </h2>
<ul>
@foreach (var blog in Model.Blogs)
{
<li>
@blog.Name
</li>
}
</ul>

21
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 namespace Volo.Blogging.Pages.Blog
{ {
public class IndexModel : PageModel public class IndexModel : AbpPageModel
{ {
public void OnGet() public List<BlogDto> Blogs { get; private set; }
public IndexModel()
{
}
public async Task OnGet()
{ {
Blogs = new List<BlogDto>
{
new BlogDto {Id = Guid.NewGuid(), Name = "abp", ShortName = "abp", Description = "a b p"}
};
} }
} }
} }

5
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml

@ -0,0 +1,5 @@
@page
@using Volo.Blogging.Pages.Blog.Posts
@model DetailModel
@{
}

16
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()
{
}
}
}

4
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml

@ -0,0 +1,4 @@
@page
@model Volo.Blogging.Pages.Blog.Posts.IndexModel
@{
}

16
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()
{
}
}
}

25
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<BloggingResource> L { get; set; }
public const string DefaultTitle = "Blog";
public string GetTitle(string title = null)
{
if (string.IsNullOrWhiteSpace(title))
{
return DefaultTitle;
}
return title;
}
}
}

5
modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj

@ -19,4 +19,9 @@
<EmbeddedResource Include="Pages\**\*.cshtml" Exclude="*.cs" /> <EmbeddedResource Include="Pages\**\*.cshtml" Exclude="*.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Remove="Pages\Blog\Posts\Detail.cshtml" />
<Content Remove="Pages\Blog\Posts\Index.cshtml" />
</ItemGroup>
</Project> </Project>

Loading…
Cancel
Save