Activities of "lataing"

ABP Framework version: v4.3.0 rc1 UI type: MVC How do I want to add attributes to these two entities?

Volo.Abp.Account.Public.Web.Pages.Account.RegisterModel.PostInput

The following method cannot be used. ObjectExtensionManager.Instance.AddOrUpdateProperty<RegisterDto, string>("Title");

Hello, @maliming. I see that every module has an extension method like this.

The attribute is extended as follows, but I don't know how to set the value for the SocialSecurityNumber attribute or how to get the value.

No unit test, case or document was found. Can you explain it for me?

Another problem is that if I can't add properties to RegisterDto, I need to rewrite AccountAppService instead of just the RegisterAsync method.

My registerdto doesn't inherit the ihasextrapropertie interface and doesn't contain the setproperty method. When I call it, I report an error. Don't I need to set anything?

Can someone help me with this problem? thank you.

Can you give me an example of how to access this new property? I don't understand. thank you.

I've read the document carefully for many times, and I don't know how to access it so that it can be displayed on the UI, and set and get values.

https://docs.abp.io/en/abp/latest/Module-Entity-Extensions

I have written how to add a new property, but I don't know how to set the referenced property.

How do I set and get it? registerDto.SetProperty("PhoneNumber", "0123456789"); Methods like this are not available. Can you give me some examples?

https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#create-update-forms https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#data-table

you can add extra property to the current Tenant object. Open YourProjectModuleExtensionConfigurator.cs and replace the ConfigureExtraProperties() method with below:

    private static void ConfigureExtraProperties() 
    { 
        OneTimeRunner.Run(() => 
        { 
            ObjectExtensionManager.Instance.Modules() 
                .ConfigureSaas(x => 
                { 
                    x.ConfigureTenant(tenant => 
                    { 
                        tenant.AddOrUpdateProperty<string>( 
                            "MyExtraProperty", 
                            property => 
                            { 
                                //validation rules 
                                property.Attributes.Add(new RequiredAttribute()); 
                                property.Attributes.Add( 
                                    new StringLengthAttribute(64) 
                                    { 
                                        MinimumLength = 4 
                                    } 
                                ); 
 
                                //...other configurations for this property 
                            } 
                        ); 
                    }); 
                }); 
        }); 
    } 

Ref: https://docs.abp.io/en/abp/latest/Module-Entity-Extensions

I still don't understand. I need to add properties to registerdto. Why configure tent object?

HI,

AppName is your front-end type, can be web, ios, angular.... . It can also be any value.

You can create a new appservices like:

[Dependency(ReplaceServices = true)] 
[ExposeServices(typeof(IAccountAppService))] 
public class  MyAccountAppService : AccountAppService 
{ 
 
 
    public MyAccountAppService(IdentityUserManager userManager, IAccountEmailer accountEmailer, IAccountPhoneService phoneService, IIdentityRoleRepository roleRepository, IdentitySecurityLogManager identitySecurityLogManager, IBlobContainer<AccountProfilePictureContainer> accountProfilePictureContainer, ISettingManager settingManager, IOptions<IdentityOptions> identityOptions) : base(userManager, accountEmailer, phoneService, roleRepository, identitySecurityLogManager, accountProfilePictureContainer, settingManager, identityOptions) 
    { 
    } 
 
    public async Task<IdentityUserDto> MyRegisterAsync(MyRegisterDto input) 
    { 
        var result =await base.RegisterAsync(new RegisterDto() {....}); 
 
        var user = await UserManager.FindByIdAsync(result.Id.ToString()); 
 
        user.Surname = input.SurName; 
            ..... 
 
        await UserManager.UpdateAsync(user); 
    } 
} 

I can't refer to myregisteraasync because the iaccountappservice interface doesn't have it. I can't refer to the myregisteraasync method.

What should I do?

  • ABP Framework version: v4.2.0
  • UI type: MVC

How do I want to add attributes to these two entities?

Volo.Abp.Account.RegisterDto Volo.Abp.Account.Public.Web.Pages.Account.RegisterModel.PostInput

The following method cannot be used. ObjectExtensionManager.Instance.AddOrUpdateProperty<RegisterDto, string>("Title");

Based on the GitHub data so far, Vue seems to be the more popular

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