0
thuc.nghiem@techplus.vn created
- ABP Framework version: v7.0.1
- UI Type: Angular
- Database System: EF Core ( Oracle.)
- Tiered (for MVC) or Auth Server Separated (for Angular): no
- Exception message and full stack trace:
- Steps to reproduce the issue:
ObjectExtensionManager.Instance.Modules().ConfigureIdentity(identity =>
{
identity.ConfigureUser(user =>
{
user.AddOrUpdateProperty<string>(UserConsts.LoanOfficer,
options =>
{
options.Attributes.Add(new RequiredAttribute());
options.Attributes.Add(new StringLengthAttribute(UserConsts.MaxLoanOfficerLength));
//options.UI.OnEditForm.IsVisible = false;
});
user.Validators.Add(context =>
{
//help check exist??
});
});
});
2 Answer(s)
-
0
Hello thuc.nghiem@techplus.vn,
As you are using
RequiredAttribute
forLoanOfficer
, If you have not passing value forLoanOfficer
from UI then it will through error/Exception.If you want to implement custom validation you can refer this https://docs.abp.io/en/abp/latest/Object-Extensions#custom-validation
Regards, Anjali
-
0
Hello Anjali. My problem is to check if it already exists and prevent it from being saved to the database. Can you provide a solution for me?