Activities of "kfrancis@clinicalsupportsystems.com"

Looks like the following:

public class BillingGroupRepository : CabMDRepository<BillingGroup, BillingGroup_Id>, IBillingGroupRepository
    {
        #region Constants

        private const string Cmd_BillingGroups_Load = "Billing.BillingGroup_Load_1 ";
        private const string BillingGroupCacheKey = "BillingGroups";

        #endregion Constants

        #region Static Force Version Check Method

        /// <summary>
        /// Force the next load of the entities to do a version check
        /// (In this case, just force a reload)
        /// </summary>
        /// <param name="cache"></param>
        internal static void ForceVersionCheck(IDistributedCache<CacheItem> cache)
        {
            try
            {
                _semaphore.Wait();
                cache.Remove(BillingGroupCacheKey);
            }
            finally
            {
                _semaphore.Release();
            }
        }

        /// <summary>
        /// Force the next load of the entities to do a version check
        /// (In this case, just force a reload)
        /// </summary>
        /// <param name="cache"></param>
        internal async static Task ForceVersionCheckAsync(IDistributedCache<CacheItem> cache)
        {
            try
            {
                await _semaphore.WaitAsync().ConfigureAwait(false);
                await cache.RemoveAsync(BillingGroupCacheKey).ConfigureAwait(false);
            }
            finally
            {
                _semaphore.Release();
            }
        }

        #endregion Static Force Version Check Method

        #region Constructors

        public BillingGroupRepository(IAsyncQueryableExecuter asyncExecuter,
                                      ICurrentUser currentUser,
                                      IConfiguration configuration,
                                      IDistributedCache<CacheItem> cache = null) 
            : base(asyncExecuter, currentUser, configuration, cache)  // these go in the regular distributed cache (see ForceVersionCheck above)
        {
        }

        #endregion Constructors

        public override string EntityTypeName => "Billing Group";
        internal override string CacheKeyPrefix => BillingGroupCacheKey;

        #region Override Caching

        protected override bool IdIsDefault(BillingGroup_Id Id)
        {
            return Id.Value == default;
        }

        protected override void DeleteEntityFromDb(BillingGroup_Id Id)
        {
            throw new NotSupportedException($"Write operations not enabled for {EntityTypeName}s");
        }

        protected override Task DeleteEntityFromDbAsync(BillingGroup_Id Id, CancellationToken ct = default)
        {
            throw new NotSupportedException($"Write operations not enabled for {EntityTypeName}s");
        }

        protected override VersionAndDelete LoadCurrentVersionFromDb()
        {
            return new VersionAndDelete { Version = 0, LastDeletion = DateTime.MinValue };
        }

        protected override DbLoadObj<BillingGroup_Id, BillingGroup> LoadEntitiesFromDb(int fromVersion)
        {
            return Db_LoadBillingGroups(fromVersion);
        }

        protected override Task<VersionAndDelete> LoadCurrentVersionFromDbAsync(CancellationToken ct = default)
        {
            return Task.FromResult(new VersionAndDelete { Version = 0, LastDeletion = DateTime.MinValue });
        }

        protected async override Task<DbLoadObj<BillingGroup_Id, BillingGroup>> LoadEntitiesFromDbAsync(int fromVersion, CancellationToken ct = default)
        {
            return await Db_LoadBillingGroupsAsync(fromVersion, ct).ConfigureAwait(false);
        }

        protected override void SaveEntity(BillingGroup entity)
        {
            throw new NotSupportedException($"Write operations not enabled for {EntityTypeName}s");
        }

        protected override Task SaveEntityAsync(BillingGroup entity, CancellationToken ct = default)
        {
            throw new NotSupportedException($"Write operations not enabled for {EntityTypeName}s");
        }

        protected override DbSaveObj<BillingGroup> SaveEntityToDb(BillingGroup entity, int currentKnownVersion)
        {
            throw new NotSupportedException($"Write operations not enabled for {EntityTypeName}s");
        }

        protected override Task<DbSaveObj<BillingGroup>> SaveEntityToDbAsync(BillingGroup entity, int currentKnownVersion, CancellationToken ct)
        {
            throw new NotSupportedException($"Write operations not enabled for {EntityTypeName}s");
        }

        #endregion Override Caching

        #region DBAccess

        private DbLoadObj<BillingGroup_Id, BillingGroup> Db_LoadBillingGroups(int FromVersion)
        {
            using IDatabase db = new Database(connectionString);
            db.AddParameter(new dbParameter("For15", true));
            DataSet ds = null;
            try
            {
                Database.ExcuteWithRetry(() => ds = db.Execute<DataSet>(Cmd_BillingGroups_Load), RetryLogger);
                return new DbLoadObj<BillingGroup_Id, BillingGroup>
                {
                    List = Db_GetBillingGroupsFromDataSet(ds),
                    Version = 0,
                    AllLoaded = true
                };
            }
            finally
            {
                if (ds != null) ds.Dispose();
            }
        }

        private async Task<DbLoadObj<BillingGroup_Id, BillingGroup>> Db_LoadBillingGroupsAsync(int FromVersion, CancellationToken ct = default)
        {
            ct.ThrowIfCancellationRequested();

            using IDatabase db = new Database(connectionString);
            db.AddParameter(new dbParameter("For15", true));
            DataSet ds = null;
            try
            {
                await Database.ExcuteWithRetryAsync(async () => ds = await db.ExecuteAsync<DataSet>(Cmd_BillingGroups_Load, ct).ConfigureAwait(false), RetryLogger, ct).ConfigureAwait(false);
                return new DbLoadObj<BillingGroup_Id, BillingGroup>
                {
                    List = Db_GetBillingGroupsFromDataSet(ds),
                    Version = 0,
                    AllLoaded = true
                };
            }
            finally
            {
                if (ds != null) ds.Dispose();
            }
        }

        private static ConcurrentDictionary<BillingGroup_Id, BillingGroup> Db_GetBillingGroupsFromDataSet(DataSet ds)
        {
            // the main list
            var retValue = DataTableConcurrentDictionary.CreateDictionary<BillingGroup_Id, BillingGroup>(ds.Tables[0], "ID");
            // get additional values
            var dvDetail = new DataView(ds.Tables[1], null, "BillingGroupID", DataViewRowState.CurrentRows);
            var dvCharge = new DataView(ds.Tables[2], null, "BillingGroupID", DataViewRowState.CurrentRows);
            var dvTax = new DataView(ds.Tables[3], null, "BillingGroupID", DataViewRowState.CurrentRows);
            // loop through each ba to get associated values
            foreach (var bg in retValue.Values)
            {
                // details
                var rows = dvDetail.FindRows(bg.Id).Select(r => r.Row);
                bg.Detail = rows.Any() ? DataTableList.CreateList<BillingGroupDetail>(rows).FirstOrDefault() : null;
                // charges
                rows = dvCharge.FindRows(bg.Id).Select(r => r.Row);
                bg.Charge = rows.Any() ? DataTableList.CreateList<BillingGroupCharge>(rows).FirstOrDefault() : null;
                // taxes
                rows = dvTax.FindRows(bg.Id).Select(r => r.Row);
                bg.Tax = rows.Any() ? DataTableList.CreateList<BillingGroupTax>(rows).FirstOrDefault() : null;
            }
            return retValue;
        }

        #endregion DBAccess
    }

The base CabMDRepository takes IConfiguration so that it can do this:

connectionString = configuration.GetConnectionString("Default");

And so in the set of tests that I want to run that check these ado/sp loading methods, I want to specify the connection string so that we can actually test.

  • ABP Framework version: v4.4.0 RC2
  • UI type: MVC
  • DB provider: Unified EF Core with custom ADO Repositories
  • Tiered (MVC) or Identity Server Separated (Angular): Tiered MVC

In our custom repositories, we're not using EF but rather using ado since we're porting an older system that primarily used stored procedures. It works great, but now that we're setting the connection string using IConfiguration I need to find a way to either inject or substitute IConfiguration with a value that I can use for function testing and I just can't figure out how yet.

I know I can just simply use something in memory like this:

protected override void AfterAddApplication(IServiceCollection services)
{ 
    var inMemorySettings = new Dictionary<string, string> {
        {"ConnectionStrings:Default", "(connection string here to a local mssql instance in a known state)"},
    };

    IConfiguration configuration = new ConfigurationBuilder()
        .AddInMemoryCollection(inMemorySettings)
        .Build();

    //var configuration = Substitute.For<IConfiguration>();

    services.AddSingleton(configuration);
}

public BillingGroupRepositoryTests()
{
    _billingGroupRepository = GetRequiredService<IBillingGroupRepository>();            
}

But when I do, the test host just crashes. When I run tests for these repositories (like IBillingGroupRepository for example) without doing anything, I'll get the somewhat expected "The ConnectionString property has not been initialized."

I've tried AfterAddApplication, BeforeAddApplication, neither helped. The TestBase project doesn't seem to do anything like this since the majority of tests can work just fine in MySql, these just can't because they rely on Stored Procedures.

protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
    base.SetAbpApplicationCreationOptions(options);

    var inMemorySettings = new Dictionary<string, string> {
        {"ConnectionStrings:Default", "(connection string here to a local mssql instance in a known state)"},
    };

    IConfiguration configuration = new ConfigurationBuilder()
        .AddInMemoryCollection(inMemorySettings)
        .Build();

    options.Services.ReplaceConfiguration(configuration);
}

Any ideas?

Here's the related code:

Domain

[DependsOn(
        typeof(CabMDDomainSharedModule),
        typeof(AbpAuditLoggingDomainModule),
        typeof(AbpBackgroundJobsDomainModule),
        typeof(AbpFeatureManagementDomainModule),
        typeof(AbpIdentityProDomainModule),
        typeof(AbpPermissionManagementDomainIdentityModule),
        typeof(AbpIdentityServerDomainModule),
        typeof(AbpPermissionManagementDomainIdentityServerModule),
        typeof(AbpSettingManagementDomainModule),
        typeof(SaasDomainModule),
        typeof(TextTemplateManagementDomainModule),
        typeof(LeptonThemeManagementDomainModule),
        typeof(LanguageManagementDomainModule),
        typeof(VoloAbpCommercialSuiteTemplatesModule),
        typeof(AbpEmailingModule),
        typeof(BlobStoringDatabaseDomainModule),
        typeof(AbpPaymentDomainModule),
        typeof(AbpPaymentPayuDomainModule),
        typeof(AbpPaymentTwoCheckoutDomainModule),
        typeof(FileManagementDomainModule), 
        typeof(DocsDomainModule),
        typeof(CmsKitProDomainModule)
        )]
    public class CabMDDomainModule : AbpModule
    {
        // lots of code
    }

EfCore (Unified)

[DependsOn(
        typeof(CabMDDomainModule),
        typeof(AbpIdentityProEntityFrameworkCoreModule),
        typeof(AbpIdentityServerEntityFrameworkCoreModule),
        typeof(AbpPermissionManagementEntityFrameworkCoreModule),
        typeof(AbpSettingManagementEntityFrameworkCoreModule),
        typeof(AbpEntityFrameworkCoreSqlServerModule),
        typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
        typeof(AbpAuditLoggingEntityFrameworkCoreModule),
        typeof(AbpFeatureManagementEntityFrameworkCoreModule),
        typeof(LanguageManagementEntityFrameworkCoreModule),
        typeof(SaasEntityFrameworkCoreModule),
        typeof(TextTemplateManagementEntityFrameworkCoreModule),
        typeof(BlobStoringDatabaseEntityFrameworkCoreModule),
        typeof(AbpPaymentEntityFrameworkCoreModule),
        typeof(FileManagementEntityFrameworkCoreModule),
        typeof(DocsEntityFrameworkCoreModule),
        typeof(CmsKitProEntityFrameworkCoreModule)
        )]
    public class CabMDEntityFrameworkCoreModule : AbpModule
    {
        // lots of code
    }

Unified DbContext:

protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

            /* Include modules to your migration db context */

            builder.ConfigurePermissionManagement();
            builder.ConfigureSettingManagement();
            builder.ConfigureBackgroundJobs();
            builder.ConfigureAuditLogging();
            builder.ConfigureIdentityPro();
            builder.ConfigureIdentityServer();
            builder.ConfigureFeatureManagement();
            builder.ConfigureLanguageManagement();
            builder.ConfigureSaas();
            builder.ConfigureTextTemplateManagement();
            builder.ConfigureCmsKitPro();
            builder.ConfigureBlobStoring();
            builder.ConfigurePayment();
            builder.ConfigureFileManagement();
            builder.ConfigureDocs();

            /* Configure the shared tables (with included modules) here */

            //builder.Entity<IdentityUser>(b =>
            //{
            //    b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "Users"); //Sharing the same table "AbpUsers" with the IdentityUser

            //    b.ConfigureByConvention();
            //    b.ConfigureAbpUser();

            //    /* Configure mappings for your additional properties.
            //     * Also see the CabMDEfCoreEntityExtensionMappings class.
            //     */
            //});

            /* Configure your own tables/entities inside the ConfigureCabMD method */

            builder.ConfigureCabMD();
        }

I'll note also that the abp suite refuses to bring up modules and the abp add-module command says it's failing but provides no information. Is there a way to get more verbose information from the CLI there?

All of those things are in place, and I've done them again with no success. Also, when I go to add a migration - it's empty and I can see that it's because the blob related tables are in from when I added CmsKitPro.

Can I email you? Since I can't produce this on a new project.

So, I've been trying to re-create the issue but I haven't yet found a set of steps useful.

I'm wondering if it's due to us adding the CmsPro kit module before this. Is there an order that is important?

dotnet build runs without error as well, so the abp add-module failure I can't figure out why it's failing. There's no verbose mode for the add-module command.

  • ABP Framework version: v4.4.0 RC2
  • UI type: MVC
  • DB provider: EF Core (Unified)
  • Tiered (MVC) or Identity Server Separated (Angular): Tiered
  • Exception message and stack trace:

Volo.Abp.AbpException: No BLOB Storage provider was registered! At least one provider must be registered to be able to use the Blog Storing System. at Volo.Abp.BlobStoring.DefaultBlobProviderSelector.Get(String containerName) at Volo.Abp.BlobStoring.BlobContainerFactory.Create(String name) at Volo.Abp.BlobStoring.BlobContainerFactoryExtensions.Create[TContainer](IBlobContainerFactory blobContainerFactory) at Volo.Abp.BlobStoring.BlobContainer`1..ctor(IBlobContainerFactory blobContainerFactory) at lambda_method1856(Closure , Object[] ) at Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate()

  • Steps to reproduce the issue:"
  1. Start with a tiered MVC unified EFCore project, like https://community.abp.io/articles/unifying-dbcontexts-for-ef-core-removing-the-ef-core-migrations-project-nsyhrtna
  2. Attempt to add the module for db blob storage:

C:\Users\kfrancis\Projects\MysteryProject\aspnet-core>abp add-module Volo.Abp.BlobStoring.Database [16:16:40 INF] ABP CLI (https://abp.io) [16:16:41 INF] Version 4.4.0-rc.2 (Prerelease) [16:16:42 INF] Installing module 'Volo.Abp.BlobStoring.Database' to the solution 'MysteryProject' Build started... Build failed. Use dotnet build to see the errors. Reinforced.Typings.settings.xml : warning : Reinforced.Typings will not run because it is disabled in its configuration [C:\Users\kfrancis\Projects\MysteryProject\aspnet-core\src\MysteryProject.Domain.Shared\MysteryProject.Domain.Shared.csproj] [16:16:51 INF] Started database migrations... [16:16:51 INF] Migrating schema for host database... [16:16:52 INF] Executing host database seed... [16:16:55 INF] Successfully completed host database migrations. [16:16:55 INF] Executing default tenant database seed... [16:16:55 INF] Successfully completed default tenant database migrations. [16:16:55 INF] Successfully completed all database migrations. [16:16:55 INF] You can safely end this process...

  1. Attempt to add it manuallly, but the tables related to the database storage aren't being added when I do add-migration
Answer

After installing CMS pro (v4.3.3) module, I'm getting the following from the API host:

[13:53:10 INF] Request starting HTTP/2 GET https://localhost:44392/swagger/v1/swagger.json - -
[13:53:10 ERR] An unhandled exception has occurred while executing the request.
Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate Operation for action - Volo.CmsKit.Admin.Comments.CommentAdminController.GetListAsync (Volo.CmsKit.Admin.HttpApi). See inner exception
 ---> Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate schema for type - Volo.Abp.Application.Dtos.PagedResultDto`1[Volo.CmsKit.Admin.Comments.CommentWithAuthorDto]. See inner exception
 ---> System.InvalidOperationException: Can't use schemaId "$CmsUserDto" for type "$Volo.CmsKit.Admin.Comments.CmsUserDto". The same schemaId is already used for type "$Volo.CmsKit.Users.CmsUserDto"
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository.RegisterType(Type type, String schemaId)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateReferencedSchema(DataContract dataContract, SchemaRepository schemaRepository, Func`1 definitionFactory)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateConcreteSchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchemaForMember(MemberInfo memberInfo, SchemaRepository schemaRepository, DataProperty dataProperty)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.CreateObjectSchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateReferencedSchema(DataContract dataContract, SchemaRepository schemaRepository, Func`1 definitionFactory)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateConcreteSchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchemaForType(Type type, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.CreateArraySchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateConcreteSchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchemaForMember(MemberInfo memberInfo, SchemaRepository schemaRepository, DataProperty dataProperty)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.CreateObjectSchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateReferencedSchema(DataContract dataContract, SchemaRepository schemaRepository, Func`1 definitionFactory)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateConcreteSchema(DataContract dataContract, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SchemaGenerator.GenerateSchemaForType(Type type, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository, PropertyInfo propertyInfo, ParameterInfo parameterInfo)
   --- End of inner exception stack trace ---
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateSchema(Type type, SchemaRepository schemaRepository, PropertyInfo propertyInfo, ParameterInfo parameterInfo)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateResponseMediaType(ModelMetadata modelMetadata, SchemaRepository schemaRespository)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateResponse(ApiDescription apiDescription, SchemaRepository schemaRepository, String statusCode, ApiResponseType apiResponseType)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateResponses(ApiDescription apiDescription, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperation(ApiDescription apiDescription, SchemaRepository schemaRepository)
   --- End of inner exception stack trace ---
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperation(ApiDescription apiDescription, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.&lt;&gt;c__DisplayClass6_1.&lt;&lt;UseMiddlewareInterface&gt;b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.&lt;&gt;c__DisplayClass6_1.&lt;&lt;UseMiddlewareInterface&gt;b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

We're trying to use abp commerial on top of an existing database, and while we've been able to convert mostly everything to work - the users are one aspect that we haven't yet addressed. Is there a way for us to "plug in" to the existing asp.net identity tables (like AspNetUsers) OR alternatively, can we convert/insert them into the new tables (AbpUsers) and have it continue to work?

Question,

We're using the dynamic and non-dynamic forms, but we're wondering if it's possible to all the use of bootstrap horizontal forms to eliminate space after the labels:

  • ABP Framework version: v4.2.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
Showing 41 to 50 of 56 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11