@liangshiwei Hello, I didn't find the <YourProjectName>BundleContributor.cs file. Can you tell me the exact location?
I created the module through suite, and did not make any changes, just run it directly. And when I run BSDemo.IdentityServer, I need to wait many minutes, which is much slower than running BSDemo.Web.Unified directly. It took 5.1 minutes to display the successful login
By the way, for the module I created, I added a page to BSDemo.Blazor.Server project. How can I run blazor server to view it?
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.
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. OpenYourProjectModuleExtensionConfigurator.cs
and replace theConfigureExtraProperties()
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 beweb
,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?
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");