### Install New ABP CLI (for new projects) Source: https://github.com/abpframework/abp/blob/dev/docs/en/cli/differences-between-old-and-new-cli.md If you are starting with ABP v8.2+ or have ABP Studio installed, use this command to install the new ABP CLI. ```bash dotnet tool install -g Volo.Abp.Studio.Cli ``` -------------------------------- ### Install and Run React App (Microservice) Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/react/index.md Navigate to the 'apps/react' directory, install dependencies, and start the React development server for microservice templates. ```bash cd apps/react npm install npm run dev ``` -------------------------------- ### Install and Run React App (Layered/Single-Layer) Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/react/index.md Navigate to the 'react' directory, install dependencies, and start the React development server for layered or single-layer templates. ```bash cd react npm install npm run dev ``` -------------------------------- ### Full Module Example for Multi-Tenancy in C# Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2026-06-04-implementing-multitenancy-in-abp-framework-a-complete/Post.md A complete example of an ABP module demonstrating multi-tenancy configuration and middleware setup. Includes service configuration and application initialization. ```csharp using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Volo.Abp.Modularity; using Volo.Abp.MultiTenancy; namespace Acme.Crm; [DependsOn( typeof(AbpMultiTenancyModule) )] public class CrmHttpApiHostModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { Configure(options => { options.IsEnabled = MultiTenancyConsts.IsEnabled; options.UserSharingStrategy = TenantUserSharingStrategy.Isolated; }); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); app.UseRouting(); app.UseAuthentication(); app.UseMultiTenancy(); app.UseAuthorization(); app.UseConfiguredEndpoints(); } } ``` -------------------------------- ### ABP Framework Installer Project Structure Example Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/modularity/installer-projects.md Illustrates the typical directory layout for an ABP Framework installer module. It shows the placement of the .csproj file, installation notes, and the main installer module class within the 'src' directory. ```tree modules/your-module/ ├── src/ │ ├── Volo.Abp.YourModule.Installer/ │ │ ├── Volo.Abp.YourModule.Installer.csproj │ │ ├── InstallationNotes.md │ │ └── Volo/ │ │ └── Abp/ │ │ └── YourModule/ │ │ └── AbpYourModuleInstallerModule.cs │ └── [other packages]/ ├── Volo.Abp.YourModule.abpmdl └── [other module files] ``` -------------------------------- ### Appsettings.json for Host Database Setup Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2026-06-04-implementing-multitenancy-in-abp-framework-a-complete/Post.md Example appsettings.json configuration for a multi-tenancy setup using a host database for tenant metadata. Specifies the connection string for the host database. ```json { "ConnectionStrings": { "Default": "Server=localhost;Database=CrmHost;Trusted_Connection=True;TrustServerCertificate=True" } } ``` -------------------------------- ### Start Angular Application with Yarn Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2021-07-08-introducing-the-eshoponabp-project/post.md This snippet shows how to navigate to the Angular application directory and start the development server using Yarn. It assumes Yarn is installed and the project dependencies are managed by it. ```bash cd apps/angular yarn start ``` -------------------------------- ### Run ABP Backend Host Source: https://github.com/abpframework/abp/blob/dev/docs/en/contribution/angular-ui.md Starts the ABP backend HTTP API host. Ensure client-side libraries are installed and connection strings are configured. ```bash cd templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds dotnet run ``` -------------------------------- ### Initialize Development Environment Source: https://github.com/abpframework/abp/blob/dev/npm/ng-packs/README.md Commands to install project dependencies and launch the development application server. This is the standard procedure to start working on the Angular UI template. ```shell yarn yarn start ``` -------------------------------- ### Install ABP CLI 4.4.0-rc.2 Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2021-06-30-abp-platform-44-rc-has-been-released/post.md Command to install the ABP CLI if it's not already installed. Use this to get started with the latest pre-release version. ```bash dotnet tool install Volo.Abp.Cli -g --version 4.4.0-rc.2 ``` -------------------------------- ### Install Volo.Abp.Autofac Package using .NET CLI Source: https://github.com/abpframework/abp/blob/dev/docs/en/get-started/empty-aspnet-core-application.md Installs the Volo.Abp.Autofac package into the project using the .NET CLI. This package is required to replace the default ASP.NET Core Dependency Injection (DI) system with Autofac, which ABP utilizes for advanced features. ```bash dotnet add package Volo.Abp.Autofac ``` -------------------------------- ### Start Emulator Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/react-native/setting-up-android-emulator.md Launch your created emulator using its AVD name. Replace `myEmu` with the name you used during creation. ```bash emulator -avd myEmu ``` -------------------------------- ### ABP Installer Module C# Example Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/modularity/installer-projects.md Example of an ABP installer module class written in C#. It configures the Virtual File System to include embedded resources from the module. This is crucial for ABP CLI and runtime resource management. ```csharp using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.Account; [DependsOn(typeof(AbpVirtualFileSystemModule))] public class AbpAccountInstallerModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { Configure(options => { options.FileSets.AddEmbedded(); }); } } ``` -------------------------------- ### Custom Extension Methods for Extra Properties in C# Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/domain-driven-design/entities.md Provides an example of creating custom extension methods for setting and getting specific properties like 'Title'. This approach enhances code readability and leverages IntelliSense for better developer experience. ```csharp public static class IdentityUserExtensions { private const string TitlePropertyName = "Title"; public static void SetTitle(this IdentityUser user, string title) { user.SetProperty(TitlePropertyName, title); } public static string GetTitle(this IdentityUser user) { return user.GetProperty(TitlePropertyName); } } ``` -------------------------------- ### Initialize Solution for ABP Studio Source: https://github.com/abpframework/abp/blob/dev/docs/en/cli/index.md Creates necessary files for a solution to be readable by ABP Studio. Use this if your solution was not generated by ABP Studio. ```bash abp init-solution [options] ``` ```bash abp init-solution --name Acme.BookStore ``` -------------------------------- ### Get Specific Navigation Events with RouterEvents (Angular) Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/angular/router-events.md This example demonstrates how to use `RouterEvents.getNavigationEvents` to subscribe to specific navigation events like 'Start' and 'End' in Angular. It also shows how to combine streams using RxJS `merge` to create a loading indicator observable. ```typescript import { RouterEvents } from '@abp/ng.core'; import { merge } from 'rxjs'; import { mapTo } from 'rxjs/operators'; @Injectable() class SomeService { private routerEvents = inject(RouterEvents); navigationStart$ = this.routerEvents.getNavigationEvents('Start'); /* Observable */ navigationFinish$ = this.routerEvents.getNavigationEvents('End', 'Error', 'Cancel'); /* Observable */ loading$ = merge( this.navigationStart$.pipe(mapTo(true)), this.navigationFinish$.pipe(mapTo(false)), ); /* Observable */ } ``` -------------------------------- ### Define Entity with GUID Primary Key Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/infrastructure/guid-generation.md Defines a 'Product' entity that inherits from AggregateRoot and uses a GUID as its primary key. This example shows the typical structure for entities in ABP Framework when using GUIDs. ```csharp using System; using Volo.Abp.Domain.Entities; namespace AbpDemo { public class Product : AggregateRoot { public string Name { get; set; } private Product() { /* This constructor is used by the ORM/database provider */ } public Product(Guid id, string name) : base(id) { Name = name; } } } ``` -------------------------------- ### ABP Local Framework References Project Setup (XML) Source: https://github.com/abpframework/abp/blob/dev/docs/en/cli/new-command-samples.md An example of the project file (`.csproj`) configuration when using local ABP framework references. It shows `` elements pointing to local ABP framework source files. ```xml ``` -------------------------------- ### Configure Application Creation Options in C# Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/fundamentals/application-startup.md Demonstrates how to use an `Action` lambda to configure application creation options, such as setting the `ApplicationName` when creating an ABP application. ```csharp using var application = await AbpApplicationFactory .CreateAsync(options => { options.ApplicationName = "MyApp"; }); ``` -------------------------------- ### JSON Configuration Example for Connection Strings Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2026-06-05-implementing-multitenancy-in-abp-framework-a-complete/Post.md An example of an appsettings.json file showing default connection string and application settings. This configuration is relevant for setting up the database connection for multi-tenant applications. ```json { "ConnectionStrings": { "Default": "Server=localhost;Database=CrmShared;Trusted_Connection=True;TrustServerCertificate=True" }, "App": { "SelfUrl": "https://localhost:44388" } } ``` -------------------------------- ### Appsettings.json for Shared Database Setup Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2026-06-04-implementing-multitenancy-in-abp-framework-a-complete/Post.md Example appsettings.json configuration for a shared database multi-tenancy setup. Specifies the connection string for the shared database. ```json { "ConnectionStrings": { "Default": "Server=localhost;Database=CrmShared;Trusted_Connection=True;TrustServerCertificate=True" } } ``` -------------------------------- ### Example Tenant Configuration Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2026-06-05-implementing-multitenancy-in-abp-framework-a-complete/Post.md Illustrates the structure of a tenant configuration object, including its ID, name, and connection strings. This is useful for understanding how tenant data is represented in code-backed store scenarios. ```json { "id": "2f7f8f8d-8f8d-4f8d-9f8d-2f7f8f8d8f8d", "name": "acme", "connectionStrings": { "Default": "Server=sql01;Database=Crm_Acme;User Id=app;Password=***;TrustServerCertificate=True" } } ``` -------------------------------- ### Example ABP Solution Creation JSON Configuration Source: https://github.com/abpframework/abp/blob/dev/docs/en/cli/new-command-samples.md This is an example JSON configuration file used by the ABP CLI to define the properties of a new solution. It includes settings for solution naming, UI framework, database provider, and various features like multi-tenancy and audit logging. ```json { "solutionName": { "fullName": "Acme.BookStore", "companyName": "Acme", "projectName": "BookStore" }, "pro": true, "useOpenSourceTemplate": false, "booksSample": false, "databaseProvider": "ef", "createInitialMigration": true, "runDbMigrator": true, "uiFramework": "angular", "theme": "leptonx", "themeStyle": "system", "mobileFramework": "none", "databaseManagementSystem": "sqlserver", "databaseManagementSystemBuilderExtensionMethod": "UseSqlServer", "connectionString": "Server=(LocalDb)\\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True;TrustServerCertificate=true", "mauiBlazorApplicationIdGuid": "d3499a09-f3d4-4bb7-9d58-4c7b1caee331", "tiered": false, "publicWebsite": false, "cmskit": false, "openIddictAdmin": true, "languageManagement": true, "textTemplateManagement": true, "multiTenancy": true, "auditLogging": false, "gdpr": true, "chat": false, "fileManagement": false, "socialLogins": true, "includeTests": true, "distributedEventBus": "none", "publicRedis": false, "separateTenantSchema": false, "progressiveWebApp": false, "runProgressiveWebAppSupport": false, "runInstallLibs": false, "runBundling": false, "kubernetesConfiguration": true, "templateName": "app" } ``` -------------------------------- ### Install Client-Side Packages Source: https://github.com/abpframework/abp/blob/dev/docs/en/tutorials/todo/layered/index.md Run this command on the root directory of your solution to install all required NPM packages. ```bash abp install-libs ``` -------------------------------- ### Start Cloudflare Tunnel Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/react-native/running-on-device.md Use this command to start the Cloudflare tunnel. Ensure cloudflared is installed and you are in the react-native folder. This script generates a tunnel-config.json and updates Environment.ts. ```bash yarn tunnel:api ``` ```bash npm run tunnel:api ``` -------------------------------- ### Configure Application Providers (TypeScript) Source: https://github.com/abpframework/abp/blob/dev/docs/en/tutorials/microservice/part-05.md Demonstrates how to integrate the `provideOrderService()` function into the application's main configuration file (`app.config.ts`). This ensures that the ordering service and its associated providers are correctly set up when the application starts. ```typescript import { provideOrderService } from '@order-service/config'; export const appConfig: ApplicationConfig = { providers: [ // ... provideOrderService() ], }; ``` -------------------------------- ### Start Angular Application Source: https://github.com/abpframework/abp/blob/dev/docs/en/tutorials/modular-crm/part-02.md Run this command in the angular folder to start the frontend development server. ```bash yarn start ``` -------------------------------- ### ABP Package Definition JSON Example (.abppkg) Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/modularity/installer-projects.md Example of a package definition file (`.abppkg`) in JSON format. It specifies the role of a particular package within the module, such as 'lib.application' for application layer packages. This helps the ABP CLI determine where to install the package. ```json { "role": "lib.application" } ``` -------------------------------- ### Connect to OpenAI-Compatible AI Service with Python SDK Source: https://github.com/abpframework/abp/blob/dev/docs/en/modules/ai-management/index.md Demonstrates how to initialize the OpenAI Python SDK to connect to an OpenAI-compatible endpoint. It requires the base URL of the application and an API key for authentication. The example shows making a chat completion request and printing the response. ```python from openai import OpenAI client = OpenAI( base_url="https://localhost:44336/v1", api_key="" ) response = client.chat.completions.create( model="MyWorkspace", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content) ``` -------------------------------- ### Install ABP CLI Source: https://github.com/abpframework/abp/blob/dev/docs/en/Blog-Posts/2026-06-30 v10_5_Release_Stable/POST.md Use this command to install the ABP CLI if you haven't already. ```bash dotnet tool install -g Volo.Abp.Studio.Cli ``` -------------------------------- ### C# Aggregate Root and Entity Example Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/domain-driven-design/entities.md Demonstrates a C# aggregate root 'Order' with a collection of 'OrderLine' entities. 'Order' has a Guid Id and 'OrderLine' uses a composite key. The example highlights constructor patterns, protected setters, and business logic encapsulation within the aggregate. ```csharp public class Order : AggregateRoot { public virtual string ReferenceNo { get; protected set; } public virtual int TotalItemCount { get; protected set; } public virtual DateTime CreationTime { get; protected set; } public virtual List OrderLines { get; protected set; } protected Order() { } public Order(Guid id, string referenceNo) { Check.NotNull(referenceNo, nameof(referenceNo)); Id = id; ReferenceNo = referenceNo; OrderLines = new List(); } public void AddProduct(Guid productId, int count) { if (count <= 0) { throw new ArgumentException( "You can not add zero or negative count of products!", nameof(count) ); } var existingLine = OrderLines.FirstOrDefault(ol => ol.ProductId == productId); if (existingLine == null) { OrderLines.Add(new OrderLine(this.Id, productId, count)); } else { existingLine.ChangeCount(existingLine.Count + count); } TotalItemCount += count; } } public class OrderLine : Entity { public virtual Guid OrderId { get; protected set; } public virtual Guid ProductId { get; protected set; } public virtual int Count { get; protected set; } protected OrderLine() { } internal OrderLine(Guid orderId, Guid productId, int count) { OrderId = orderId; ProductId = productId; Count = count; } internal void ChangeCount(int newCount) { Count = newCount; } public override object[] GetKeys() { return new Object[] {OrderId, ProductId}; } } ``` -------------------------------- ### Publish Standard Web UI and API Host Source: https://github.com/abpframework/abp/blob/dev/docs/en/solution-templates/layered-web-application/deployment/deployment-iis.md Commands to publish the standard web UI and API host projects. Replace 'Volo.Sample' with your project's name. ```bash dotnet publish ./src/Volo.Sample.Web/Volo.Sample.Web.csproj -c Release -o ./publish/web # Replace with your project name ``` -------------------------------- ### Reinstall ABP Suite (Bash) Source: https://github.com/abpframework/abp/blob/dev/docs/en/suite/how-to-uninstall.md These commands guide the reinstallation of ABP Suite after a clean uninstall. It requires the ABP CLI to be installed and involves logging in and then installing the suite. ```bash abp login ``` ```bash abp suite install ``` ```bash abp suite install --preview ``` -------------------------------- ### Run ABP Application with MVC and EF Core in Bash Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2025-12-06-Implement-Automatic-Method-Level-Caching-in-ABP-Framework/post.md Provides the command-line instructions to create a new ABP Framework project using the MVC UI and Entity Framework Core data access layer, navigate into the project directory, and run the application. This is a standard setup procedure for ABP projects. ```bash abp new BookStore -u mvc -d ef cd BookStore dotnet run --project src/BookStore.Web ``` -------------------------------- ### Implement Entity with GUID Key and Constructors in C# Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/domain-driven-design/entities.md This C# example demonstrates a 'Book' entity inheriting from 'Entity', featuring specific constructors for initialization and deserialization. It emphasizes the importance of a private/protected default constructor for ORM compatibility and a public constructor that accepts a GUID ID. ```csharp public class Book : Entity { public string Name { get; set; } public float Price { get; set; } protected Book() { } public Book(Guid id) : base(id) { } } ``` -------------------------------- ### Install Sitemap Module Demo Repository Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2025-12-13-Building-Dynamic-XML-Sitemaps-With-ABP-Framework/post.md Clones the demo repository containing the sitemap module. This is the first step to integrate the module into your project. ```bash git clone https://github.com/salihozkara/AbpSitemapDemo cd AbpSitemapDemo ``` -------------------------------- ### ABP Installer Project CSPROJ Configuration Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/architecture/modularity/installer-projects.md Example of a .csproj file for an ABP installer project. It references the Virtual File System and embeds module metadata files (`.abpmdl`, `.abppkg`) as content, making them available for packaging and CLI processing. ```xml net9.0 true true content \ true content \ ``` -------------------------------- ### Create Microservice Solution with React UI Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/react/index.md Use the ABP CLI to create a new microservice solution with React as the UI framework. ```bash abp new Acme.BookStore --template microservice --modern --ui-framework react ``` -------------------------------- ### Install Yarn Package Manager (Bash) Source: https://github.com/abpframework/abp/blob/dev/docs/en/get-started/pre-requirements.md Installs the Yarn package manager globally using npm. Yarn is used for managing frontend dependencies and build tasks, particularly in ABP Angular projects. This command installs the classic version of Yarn. ```bash npm install --global yarn ``` -------------------------------- ### HATEOAS Example Response Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2025-09-11-Best-Practices-Guide-for-REST-API-Design/post.md An example of a JSON response demonstrating HATEOAS principles. It includes a 'links' array with self-referential and action-oriented URIs for a user resource, enabling API discoverability. ```json { "id": 1, "name": "Deo Steel", "links": [ { "rel": "self", "href": "/users/1", "method": "GET" }, { "rel": "update", "href": "/users/1", "method": "PUT" }, { "rel": "delete", "href": "/users/1", "method": "DELETE" } ] } ``` -------------------------------- ### Create New ABP Project with Specific UI and Database Source: https://github.com/abpframework/abp/blob/dev/docs/en/Blog-Posts/2022-03-08 v5_2_Preview/POST.md This command creates a new ABP project with specified UI framework (Angular) and database provider (MongoDB). The `--preview` flag indicates it's a preview version. This is useful for setting up projects with non-default configurations. ```bash abp new BookStore -t app-nolayers -u angular -d mongodb --preview ``` -------------------------------- ### ABP Framework Sequential GUID Generation Example Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2025-10-03-Generating-Sequential-GUIDs/Post.md Demonstrates how to use ABP Framework's IGuidGenerator to create sequential GUIDs for entity IDs, avoiding the performance pitfalls of Guid.NewGuid(). This method is integrated into ABP's default configuration for entity IDs. ```csharp public class MyProductService : ITransientDependency { private readonly IRepository _productRepository; private readonly IGuidGenerator _guidGenerator; public MyProductService( IRepository productRepository, IGuidGenerator guidGenerator) { _productRepository = productRepository; _guidGenerator = guidGenerator; } public async Task CreateAsync(string productName) { var product = new Product(_guidGenerator.Create(), productName); await _productRepository.InsertAsync(product); } } ``` -------------------------------- ### Install ABP Angular SSR Schematics Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/angular/ssr-configuration.md Installs SSR support for your Angular application using ABP Framework schematics. This command automates the setup by adding necessary dependencies and configuration files. ```shell yarn ng generate @abp/ng.schematics:ssr-add yarn ng generate @abp/ng.schematics:ssr-add --project MyProjectName ``` -------------------------------- ### Install Android SDK Components (Windows) Source: https://github.com/abpframework/abp/blob/dev/docs/en/framework/ui/react-native/setting-up-android-emulator.md Install essential Android SDK components including platform tools, a specific Android platform, a system image, and the emulator on Windows systems. Ensure the SDK root path is correctly specified. ```cmd sdkmanager --sdk_root=C:\Android "platform-tools" "platforms;android-35" "system-images;android-35;google_apis;x86_64" "emulator" ``` -------------------------------- ### Install ABP CLI Source: https://github.com/abpframework/abp/blob/dev/docs/en/cli/index.md Install the ABP CLI as a global .NET tool. This command should be run in a command-line window. ```bash dotnet tool install -g Volo.Abp.Studio.Cli ``` -------------------------------- ### Install pgvector.EntityFrameworkCore NuGet Package Source: https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/post.md Installs the necessary NuGet package for integrating pgvector with Entity Framework Core. This is the first step to enable vector database capabilities in your .NET application. ```bash dotnet add package Pgvector.EntityFrameworkCore ``` -------------------------------- ### Install ABP CLI Source: https://github.com/abpframework/abp/blob/dev/docs/en/Blog-Posts/2026-03-31 v10_2_Release_Stable/POST.md Installs the ABP CLI globally. Use this if you haven't installed it yet. ```bash dotnet tool install -g Volo.Abp.Studio.Cli ```