Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "asbbh"

I recently came across the article, "Building a Modular Monolith Application with ASP.NET Zero", which was very insightful. I am planning to upgrade my project to a modular monolith structure in order to take advantage of the latest version of ASP.NET Zero. However, my project uses Angular as the frontend, not MVC.

Could you provide guidance or ideas on how to implement a modular monolith architecture on the Angular client side, as opposed to the MVC approach? Any best practices or examples would be really helpful.

Hi. Server Docker is able to connect with docker SQL. The only issue in migration Docker. It is unable to connect. The error is throwing in the connection initialization part (your code)

docker-compose.yml<br&gt; ======

schoolaut0mater.migrator: image: ${DOCKER_REGISTRY-}schoolaut0mater-migrator container_name: schoolaut0mater_migrator build: context: ../../ dockerfile: src/SchoolAut0mater.Migrator/Dockerfile environment: - ASPNETCORE_Docker_Enabled=true - ConnectionStrings__Default=Server=${DB_HOST:-tcp:127.0.0.1,1433};Database=${DB_NAME:-SchoolAut0materv12};User=sa;Password=${SA_PASSWORD:-Super_Encrypted_Passw0rd!}; networks: - schoolaut0mater

.ENV FILE<br/> ====== DB_HOST=tcp:127.0.0.1,1433 DB_NAME=SchoolAut0materv12 SA_PASSWORD=<secret> SA_USR=SA OUTPUT<br/> ====== Program: ASPNETCORE_Docker_Enabled = True Host database: Server=tcp:127.0.0.1,1433;Database=SchoolAut0materv12;User=sa;Password=; 2023-08-08 11:37:10 | Host database: Server=tcp:127.0.0.1,1433;Database=SchoolAut0materv12; 2023-08-08 11:37:10 | HOST database migration started... Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnectionString connectionOptions, Boolean withFailover) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool) at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry, SqlConnectionOverrides overrides) at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.OpenDbConnection(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass18_0.<Exists>b__0(DateTime giveUp) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c__DisplayClass12_02.<Execute>b__0(DbContext _, TState s) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, TState state, Func2 operation, Func2 verifySucceeded) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists() at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists() at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrate(AbpTenantBase tenant, Action1 seedAction) at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator1.CreateOrMigrateForHost(Action`1 seedAction) at SchoolAut0mater.Migrator.MultiTenantMigrateExecuter.Run(Boolean skipConnVerification, Boolean isDockerEnabled) in /src/src/SchoolAut0mater.Migrator/MultiTenantMigrateExecuter.cs:line 71 at SchoolAut0mater.Migrator.Program.Main(String[] args) in /src/src/School

HI,

  • I have added a property StaffId in src/SchoolAut0mater.Application.Shared/Sessions/Dto/GetCurrentLoginInformationsOutput.cs.
  • In src/SchoolAut0mater.Application/Sessions/SessionAppService.cs, I have initialize the value
output.Tenant.SubscriptionDateString = GetTenantSubscriptionDateString(output);
                output.Tenant.CreationTimeString = output.Tenant.CreationTime.ToString("d");

                try
                {
                    if (AbpSession.UserId.HasValue)
                    {
                        var emailAddress = $"{output.User.EmailAddress}".Trim();
                        var currentStaff = await _staffMasterRepo.FirstOrDefaultAsync(s => string.Equals(s.SchoolEmail, emailAddress));
                        if (currentStaff != null)
                        {
                            output.User.StaffId = currentStaff.Id;
                        }
                    }
                }
                catch { }

But on client side I am not able to see any data in abp.

I am using abpZero on Type 'ASP.NET CORE & Angular', Framework '.NET 7.0', and Version 'v12.1.0'.

I want to add some custom **abp.session ** so that I can use it inside the angular component.

How can I add an property as child of abp.session, where the data from table.

I am using this document https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Development-Guide-Rad-Tool-Mac-Linux for running AspNetZeroRadTool on Mac OS Ventura (13.3.1) to generate a scaffolding for an entity (attached) on Type 'ASP.NET CORE & Angular', Framework '.NET 7.0' and Version 'v12.1.0'

Most of the part is executed but throws an error

PS /Volumes/Projects/aspZero/SchoolAut0materv12.1.1/aspnet-core/AspNetZeroRadTool> dotnet AspNetZeroRadTool.dll Core.AcademicYear.AcademicYear.json -> SchoolAut0mater.Application.Shared\Core\AcademicYear\IAcademicYearsAppService.cs is being generated. -> SchoolAut0mater.Core\Core\AcademicYear\AcademicYear.cs is being generated. -> SchoolAut0mater.Application\Core\AcademicYear\AcademicYearsAppService.cs is being generated. -> SchoolAut0mater.Core.Shared\Core\AcademicYear\AcademicYearConsts.cs is being generated. -> SchoolAut0mater.Application.Shared\Core\AcademicYear\Dtos\GetAllForLookupTableInput.cs is being generated. -> SchoolAut0mater.Application.Shared\Core\AcademicYear\Dtos\CreateOrEditAcademicYearDto.cs is being generated. -> SchoolAut0mater.Application.Shared\Core\AcademicYear\Dtos\GetAcademicYearForViewDto.cs is being generated. -> SchoolAut0mater.Application.Shared\Core\AcademicYear\Dtos\GetAllAcademicYearsInput.cs is being generated. -> SchoolAut0mater.Application.Shared\Core\AcademicYear\Dtos\GetAcademicYearForEditOutput.cs is being generated. -> SchoolAut0mater.Application.Shared\Core\AcademicYear\Dtos\AcademicYearDto.cs is being generated. -> \..\src\SchoolAut0mater.Core\Authorization\App2Permissions.cs is being modified. -> \..\src\SchoolAut0mater.Core\Authorization\App2AuthorizationProvider.cs is being modified. -> \..\src\SchoolAut0mater.EntityFrameworkCore\EntityFrameworkCore\SchoolAut0materDbContext.cs is being modified. -> \..\src\SchoolAut0mater.Application\Custom2DtoMapper.cs is being modified. -> app\main\academicYear\academicYears\academicYears.component.ts is being generated. -> app\main\academicYear\academicYears\view-academicYear.component.ts is being generated. -> app\main\academicYear\academicYears\academicYears.component.html is being generated. -> app\main\academicYear\academicYears\academicYear.module.ts is being generated. -> app\main\academicYear\academicYears\create-or-edit-academicYear.component.ts is being generated. -> app\main\academicYear\academicYears\academicYear-routing.module.ts is being generated. -> app\main\academicYear\academicYears\view-academicYear.component.html is being generated. -> app\main\academicYear\academicYears\create-or-edit-academicYear.component.html is being generated. -> \..\..\angular\src\app\main\main-routing.module.ts is being modified. -> \..\..\angular\src\app\shared\layout\nav\app-navigation.service.ts is being modified. -> \..\..\angular\src\shared\service-proxies\service-proxy.module.ts is being modified. -> \..\src\SchoolAut0mater.Core\Localization\SchoolAut0mater\SchoolAut0mater.xml is being modified. -> Formatting generated client side files. Could not format file /Volumes/Projects/aspZero/SchoolAut0materv12.1.1/angular/src/app/main/academicYear/academicYears/academicYears.component.ts System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'cmd.exe' with working directory '/Volumes/Projects/aspZero/SchoolAut0materv12.1.1/aspnet-core/AspNetZeroRadTool'. No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at AspNetZeroRadTool.FileWizards.CodeFormatting.ExternalCodeFormatter.RunFormatCommandInPath(String path, String command)

Formatting generated client-side files. Could not format file /Volumes/Projects/aspZero/SchoolAut0materv12.1.1/angular/src/app/main/academicYear/academicYears/academicYears.component.ts System.ComponentModel.Win32Exception (2): An error occurred trying to start the process 'cmd.exe' with working directory '/Volumes/Projects/aspZero/SchoolAut0materv12.1.1/aspnet-core/AspNetZeroRadTool'. No such file or directory

plz help

====================Core.AcademicYear.AcademicYear.json====================

{
  "IsRegenerate": false,
  "MenuPosition": "main",
  "RelativeNamespace": "Core.AcademicYear",
  "EntityName": "AcademicYear",
  "EntityNamePlural": "AcademicYears",
  "TableName": "AcademicYears",
  "PrimaryKeyType": "int",
  "BaseClass": "CreationAuditedEntity",
  "EntityHistory": false,
  "AutoMigration": false,
  "UpdateDatabase": false,
  "CreateUserInterface": true,
  "CreateViewOnly": true,
  "CreateExcelExport": false,
  "IsNonModalCRUDPage": true,
  "IsMasterDetailPage": false,
  "PagePermission": {
    "Host": false,
    "Tenant": true
  },
  "Properties": [
    {
      "Name": "Code",
      "Type": "int",
      "MaxLength": -1,
      "MinLength": -1,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      },
      "ViewType": null,
      "AdditionalData": {}
    },
    {
      "Name": "Name",
      "Type": "string",
      "MaxLength": -1,
      "MinLength": -1,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": true,
        "CreateOrUpdate": false
      },
      "ViewType": null,
      "AdditionalData": {}
    },
    {
      "Name": "Terms",
      "Type": "string",
      "MaxLength": 1000,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": true,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      },
      "ViewType": null,
      "AdditionalData": {}
    },
    {
      "Name": "StartDate",
      "Type": "DateTime",
      "MaxLength": -1,
      "MinLength": -1,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": true,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": true,
        "CreateOrUpdate": true
      },
      "ViewType": null,
      "AdditionalData": {}
    },
    {
      "Name": "EndDate",
      "Type": "DateTime",
      "MaxLength": -1,
      "MinLength": -1,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": true,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": true,
        "CreateOrUpdate": true
      },
      "ViewType": null,
      "AdditionalData": {}
    },
    {
      "Name": "IsExpired",
      "Type": "bool",
      "MaxLength": -1,
      "MinLength": -1,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": true,
        "CreateOrUpdate": false
      },
      "ViewType": null,
      "AdditionalData": {}
    },
    {
      "Name": "IsActive",
      "Type": "bool",
      "MaxLength": -1,
      "MinLength": -1,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      },
      "ViewType": null,
      "AdditionalData": {}
    }
  ],
  "NavigationProperties": [],
  "NavigationPropertyOneToManyTables": [],
  "EnumDefinitions": [],
  "DbContext": null
}

I have a service which is sort of iterating a longs list of items, I like to get update on client side when it finosh each item. Is their any possibility of triggering custom Signalr when EventBus.Trigger is fired.

I am developing an application in ASP.NET CORE & Angular v9.3.0, I have enabled the Hangfire successfully, But line to schedule a task/job which runs daily 7AM and 3PM. without user or manual intervision. My understading on the hangfire is to use Recurring Job, But Dont have any inplementation avaliable as like 'Abp.BackgroundJobs.IBackgroundJobManager'.

Every time an entiry is saved on to database the Job should be schedules to run that pirticular entity setting job 2 or 3 times a day based on the value given in the entity by end user. Also when user updated the entity, all the schedules jopbs for that pirticular task shold be readjusted accordinngly.

Showing 1 to 8 of 8 entries