SergeyDavidovich / OMSBlazor

Real-time Order Management System
https://stupeni.net
MIT License
1 stars 1 forks source link

Real-time Order Management System

How start your application

In order to start application you should start HttpApi.Host project first, then start .Blazor project In order to log in to the system use this default credentials: Login - admin, password - **1q2w3E***


1. Switch to EF Core SQLite Provider:
https://docs.abp.io/en/abp/latest/Entity-Framework-Core-SQLite

For SQLite connection string use this pattern: "Filename=./MyDatabaseName.db", this pattern will create databases in bin folder of the project where migrations are executed

2. Separate host and identity data bases-

3. Make manipulations with host database

In previous step we separated host and identity databases. So let make a test migration to host database.

First of all put your database in this folder .DbMigrator->bin->Debug->net7.0

Follow this steps:

4. Add configuration for SQLite

In the OMSBlazorEntityFrameworkCoreModule class of the .EntityFrameworkCore project add this lines of code:

//This configuration is needed for sqlite
//https://github.com/abpframework/abp/issues/5661?ysclid=lhfcwt9oqb875559031
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
    options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});

5. Add required connection strings

In appsettings.json file of the .HttpApi.Host project add this connection strings:

"Default": "Filename=./NorthwindSQLite.db",
"AbpIdentity": "Filename=./NorthwindIdentitySQLite.db",
"AbpFeatureManagement": "Filename=./NorthwindIdentitySQLite.db",
"AbpAuditLogging": "Filename=./NorthwindIdentitySQLite.db"

Default - connection string is needed for connecting to the database where you store your Northwind Why do we need other three connection strings(AbpIdentity, AbpFeatureManagement, AbpAuditLogging)? So this three connection strings are pointing to the database where tables for related module stored. So for example in this current case tables for Identity, Feature, and Audit logging modules are stored in NorthwindIdentitySQLite database. If you don't write this connection strings ABP will try to find this tables in the Default connection string(this is how Abp works)