401‐CREATING ABP PROJECT TO START DEVELOPMENT - chempkovsky/CS82ANGULAR GitHub Wiki

Organizing folders

This presentation explains how to create projects for the client and server sides.

  • Let's start by organizing folders:
    • Suppose, the root folder name for all projects will be E:\Development\rupbes.firstapp

Creating Project

  • run Command Prompt and make E:\Development\rupbes.firstapp folder active
C:\>e:
e:\>cd E:\Development\rupbes.firstapp
E:\Development\rupbes.firstapp>
  • create solution using Abp CLI
abp new rupbes.firstapp --template app --ui-framework angular --theme leptonx-lite --database-provider ef --database-management-system SqlServer --no-tests --connection-string "Data Source=SQLSRV\\MSSQL2019;Initial Catalog=firstapp;Persist Security Info=True;User ID=sa;Password=your_password_here;TrustServerCertificate=True"
  • create solution using Abp Studio
    • Run Abp studio
    • Click New Solution
    • Click "Aplication (Layered)"
      • Click Next
    • Name: rupbes.firstapp
      • Enter Output folder: E:\development
      • Check the box "Create solution folder"
      • Click Next
    • Click "Angular"
      • Click Next
    • Click Choose EF
      • Check the box "Create initial migration"
      • Check the box "Run database migrator"
      • Click Next
    • Click "Sql Server"
      • Connection string: Data Source=SQLSRV\MSSQL2019;Initial Catalog=firstapp;Persist Security Info=True;User ID=sa;Password=your_password_here;TrustServerCertificate=True
      • Click Next
    • Enable Multi-tenancy
      • Click Next
    • Click "LeptonX Light"
      • Click Next
    • Uncheck the box "Include Tests"
    • Uncheck the box "Setup as modular solution"
    • After creating a project Right Click solution node and choose "Abp cli/install libs"

Modeling Time Structures and Build Time Structures

  • Entity Framework DB Contexts and Entities are used as a modeling tools. And structures during modeling may differ from structures that will be used during assembly. As a result, we need a way with which we can quickly switch all projects from simulation mode to build mode and vice versa. In case of only one project we can use #define-keywords for conditional compiling. But in case of many projects it's not so convenient. Read the articles Customize your build and docker container does not seem to find the directory.build.props and Solution-wide #define
  • With any editor we create the Directory.Build.props-file with the following content.
<Project>
    <PropertyGroup>
        <DefineConstants>NOTMODELING</DefineConstants>
    </PropertyGroup>
</Project>
  • We save Directory.Build.props-file in the E:\Development\rupbes.firstapp-folder.
  • As a result, we can write code like below
#if (!NOTMODELING)
// any valid code here that will be ignored at compile and run time 
#endif
⚠️ **GitHub.com Fallback** ⚠️