Giter Club home page Giter Club logo

sample-blog-module's Introduction

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.

sample-blog-module's People

Contributors

hikalkan avatar ismcagdas avatar yekalkan avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.