Activities of "beuko"

  • ABP Framework version: v4.4.2
  • UI type: MVC
  • DB provider: EF Core

Hello,

I know this is not realated to ABP but I wonder if you can help me.

I am following this guide for implementing many to many relationship between two entities as it is mentioned few times in forum posts ( Link ).

The problem I have is that my AppService is returning null for BookCategory list.

I included BookCategory in EfCoreBookRepository created by ABP Suite, but I still get null...

Hi.

It is working now.

Thanks

You can also retry the steps. Before retry please delete the cache templates in C:\Users\yourname\.abp\templates

For me it is not working...

ABP cli: 4.4.1 ABP suite: 4.4.1

Suite is generating project with 5.0.0 packages. Downgrading version and reinstalling abp cli and suite not helping.

Answer

Hello,

After installing latest version (4.4.1) abp suite is generating my project with 5.0.0 packages.

ABP cli: 4.4.1 ABP suite: 4.4.1

Reinstalling CLI and suite is not helping, installing older version of CLI and suite is not helping also. If I try and switch to stable packages nothing happens (it stay on 5.0.0)

  • ABP Framework version: v4.3.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hello.

I have problems with my background worker and audit logs.

I created background worker (AsyncPeriodicBackgroundWorkerBase) as written here https://docs.abp.io/en/abp/latest/Background-Workers

All my logic for worker is in .Application (so I can get data from other repositories too) and registration of worker is in .Domain. So what my worker is doing:

  • Get all users
  • Check few conditions
  • If all conditions are true, send email to user

The problem I have is that my background worker add empty log to database and then my Audit Log page on Angular is not showing any record.

AbpAuditLogs record:

77D52432-2114-0BB5-301C-39FE27C35A76 NULL NULL NULL NULL NULL NULL NULL 2021-08-05 11:13:05.3309880 5181 NULL NULL NULL 57b7b5ca3bb7408cab6e6525112e1cd9 NULL NULL NULL NULL {} e5867ffa4103491fa16d61e226d75790

AbpAuditLogActions record:

0B1276A4-5EE4-C8E9-29C1-39FE27C35A78 NULL 77D52432-2114-0BB5-301C-39FE27C35A76 MyProject.ImportDatas.ImportDataAppService SentEmailToUsersAsync {} 2021-08-05 11:13:05.3310275 5180 {}

Audit Log page:

Console errors:

Hi,

I don't understand your answer. Can you provide sample or link to sample?

Thank you

Thank you for answer and link.

Hello liangshiwei,

I already customized angular UI to show this field, now I need to get value from database (via DTO extensions) and also save it back to database.

AppUser.cs

//added this line
public bool EmailNotifications { get; protected set; }

Application.Contracts/SKAPDtoExtensions.cs

public static class SKAPDtoExtensions
    {
        private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();

        public static void Configure()
        {
            OneTimeRunner.Run(() =>
            {
                /* You can add extension properties to DTOs
                 * defined in the depended modules.
                 *
                 * Example:
                 *
                 * ObjectExtensionManager.Instance
                 *   .AddOrUpdateProperty<IdentityRoleDto, string>("Title");
                 *
                 * See the documentation for more:
                 * https://docs.abp.io/en/abp/latest/Object-Extensions
                 */

                ObjectExtensionManager.Instance
                .AddOrUpdateProperty<bool>(
                    new[]
                    {
                        typeof(ProfileDto),
                        typeof(UpdateProfileDto)
                    },
                    "EmailNotifications"
                );

            });
        }
    }

Domain.Shared/SKAPModuleExtensionConfigurator.cs

public static class SKAPModuleExtensionConfigurator
    {
        private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();

        public static void Configure()
        {
            OneTimeRunner.Run(() =>
            {
                ConfigureExistingProperties();
                ConfigureExtraProperties();
            });
        }

        private static void ConfigureExtraProperties()
        {
            /* You can configure extra properties for the
             * entities defined in the modules used by your application.
             *
             * This class can be used to define these extra properties
             * with a high level, easy to use API.
             *
             * Example: Add a new property to the user entity of the identity module

               ObjectExtensionManager.Instance.Modules()
                  .ConfigureIdentity(identity =>
                  {
                      identity.ConfigureUser(user =>
                      {
                          user.AddOrUpdateProperty<string>( //property type: string
                              "SocialSecurityNumber", //property name
                              property =>
                              {
                                  //validation rules
                                  property.Attributes.Add(new RequiredAttribute());
                                  property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4});

                                  //...other configurations for this property
                              }
                          );
                      });
                  });

             * See the documentation for more:
             * https://docs.abp.io/en/abp/latest/Module-Entity-Extensions
             */


            ObjectExtensionManager.Instance.Modules()
            .ConfigureIdentity(identity =>
            {
                identity.ConfigureUser(user =>
                {
                    user.AddOrUpdateProperty<bool>(
                        "EmailNotifications",
                        options =>
                        {
                            options.DefaultValue = false;
                        }
                    );
                });
            });

        }
    }
Showing 1 to 10 of 20 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09