Activities of "beuko"

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)

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;
                        }
                    );
                });
            });

        }
    }

Hello albert.

I have question which is related to this topic.

I added field which is FK of another table to AppUser. It shows on UI (Angular), but input is typeahead. Is there any way we can change that to dropdown? Thanks for answer!

Hi, thanks for answer.

I created file but I can not extend ProfileDto and UpdateProfileDto. What am I missing? I have boolean field EmailNotifications, which I added to AppUser class and to MyProjectExtensionConfigurator. It shows on Administrations/Identity Managament/Users and also it works when I edit it there. Now I want to add this field to Personal info, so user can check/uncheck it himself. I followed your guide but can not add my custom property to ProfileDto. I found this line of code which populated ExtraProperties of ProfileDto but not also UpdateProfileDto. What am I doing wrong?

Thanks for your answers!

Showing 1 to 10 of 15 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11