In this blog post, I will walk you through downloading ASP.NET Boilerplate Application Framework and getting it up and running with .Net Core 2.1, Entity Framework core, Angular and PostgreSql.
In this blog post, I will walk you through downloading ASP.NET Boilerplate Application Framework and getting it up and running with .Net Core 2.1, Entity Framework core, Angular and PostgreSql.
ASP.NET Boilerplate is a general purpose application framework especially designed for new modern web applications. It uses already familiar tools and implements best practices around them to provide you a SOLID development experience.
The reason why you would be interested into this awesome framework is because of its layered architecture, modular design, domain driven design and its absolutely free. After setting up a base ASP.NET Boilerplate you just get some of the features like login, registration, token authentication, user and role management etc right away. To know more about ASP.NET Boilerplate, just visit their web site.
So, let's get started with our first step towards setting up ASP.NET Boilerplate application framework with Angular6, ASP.NET Core and PostgreSql
Before we jump start our development with ASP.NET Boilerplate we just need to make sure you are having right development environment setup. I am using windows machine for development and here are things that you would probably need:
While downloading .Net Core SDK and Runtime, please make sure you are installing x64 version or x86 version of both. Version mismatch of SDK and Runtime may leave your development environment not working while debugging .Net Core applications. If you have intalled any of the above things recently, please restart your machine before you continue.
Go to ASP.NET Boilerplate Download page. Here you will be able to choose various options related to technology stack that you want to use and ASP.NET Boilerplate will generate a project for you. Here is what we have used:
Unzip your project and goto Angular folder. Open the folder in command prompt and run following command:
npm install
This will install all node modules required for Angular6 project. Once this is completed successfully, run following command:
npm start
This will take a while and front end project will start running. You should be able to browse the front end project now.
install-package Npgsql.EntityFrameworkCore.PostgreSQL
install-package Npgsql.EntityFrameworkCore.PostgreSQL.Design
public static void Configure(DbContextOptionsBuilder builder, string connectionString) { // builder.UseSqlServer(connectionString); builder.UseNpgsql(connectionString); }
public static void Configure(DbContextOptionsBuilder builder, DbConnection connection) { // builder.UseSqlServer(connection); builder.UseNpgsql(connection); }
Add-Migration "Initial"
Update-DatabaseIf your databse connection strings are correct, this two commands will be successfully executed and after that you will be able to see your databse populated with required tables.
Some part of the steps are described here, but not all steps from this document are required.
You are ready to get started with your application. Follow the documentation and start building your app!
Subscribe to Facile Technolab's monthly newsletter to receive updates on our latest news, offers, promotions, resources, source code, jobs and other exciting updates.