A Sample blog module built on ABP and module-zero
Перейти к файлу
İsmail ÇAĞDAŞ 6f5879a879
Merge pull request #12 from aspnetboilerplate/upgrade-to-latest-abp
Upgrade to latest ABP
2019-12-19 12:14:35 +03:00
app update src projects in app 2019-12-10 10:15:41 +03:00
nupkg upgraded to ABP 3.4 2018-02-07 13:43:09 +03:00
src replace existing migrations with new migration 2019-12-10 11:38:31 +03:00
.gitattributes Update .gitattributes 2019-01-14 15:38:49 +03:00
.gitignore Prepared nuget packages 2015-07-16 12:04:40 +03:00
LICENSE Initial commit 2015-07-14 10:15:06 +03:00
README.md Update README.md 2019-06-10 22:45:11 +03:00

README.md

Important

Issues of this repository are tracked on https://github.com/aspnetboilerplate/aspnetboilerplate. Please create your issues on https://github.com/aspnetboilerplate/aspnetboilerplate/issues.

sample-blog-module

A Sample blog module built on ABP and module-zero. src folder contains the sample blog module. app folder contains an application uses the blog module.

Nuget packages for blog module

How to install

app folder contains an application that installed the blog module. If you just want to test it, you can download it and skip to "Run migrations" section.

Create your project

Create an "ABP + module zero" project template from http://www.aspnetboilerplate.com/Templates. If you have a created project, skip this step.

Install nuget packages

Blog module actually consists of 4 sub-modules: Core (domain) layer, EntityFramework infrastructure, Application layer and Web (presentation) layer. Install each package to appropriate projects in your solution:

  • Abp.Samples.Blog.Core to your .Core project (OPTIONAL).
  • Abp.Samples.Blog.EntityFramework to your .EntityFramework project (OPTIONAL).
  • Abp.Samples.Blog.Application to your application project (OPTIONAL).
  • All (Abp.Samples.Blog.Core, Abp.Samples.Blog.EntityFramework, Abp.Samples.Blog.Application, Abp.Samples.Blog.Web) to your .Web project.

Note: OPTIONAL steps are not required in order to run web application. For example, you should add Abp.Samples.Blog.Core to your .Core project only if you want to directly use Blog entities in your domain layer.

Add module dependencies

  • Add [DependsOn(typeof(AbpSampleBlogCoreModule))] for your Core module/project (OPTIONAL).
  • Add [DependsOn(typeof(AbpSampleBlogApplicationModule))] for your Application module/project (OPTIONAL).
  • Add [DependsOn(typeof(AbpSampleBlogEntityFrameworkModule))] for your EntityFramework module/project (OPTIONAL).
  • Add [DependsOn(typeof(AbpSampleBlogWebModule), typeof(AbpSampleBlogEntityFrameworkModule))] for your Web module/project.

Note: OPTIONAL steps are not required in order to run web application. These dependencies just force initialize orders of modules.

Run migrations

Run EntityFramework migrations to create database schema for blog module.

To run migrations from command line, we first create an empty folder, copy all files from "packages\EntityFramework.6.1.3\tools" to this new folder. Also, copy all files from "MyAbpZeroProject.Web\bin" (project should be built in Debug once) to this new folder (EF version or project name may be different for your case). Then we can use migrate.exe to update database:

migrate.exe Abp.Samples.Blog.EntityFramework.dll /connectionString="Server=localhost;Database=YOUR_DATABASE;User=sa;Password=YOUR_PASSWORD;" /connectionProviderName="System.Data.SqlClient"

Note that, from now we have 2 different migrations: One for our application and one for blog module. We first run our own migrations since blog module requires AspNet Zero tables exist in the database.

Run the application

After these steps, we can run the application. After login, we see that a new menu item called 'Blog' added to the main menu. We can click it to enter admin page for the blog.

Notes

This module is developed to be a sample for module development. It's pretty new and there is no much functionality for now.

If you are using ABP's ASP.NET MVC 5.x & AngularJs template, then you need to add a new menu item for the blog in "sidebar-nav.js" because menu items are defined in client side for ASP.NET MVC 5.x & AngularJs template.