Partial class validation is not working

Hi, 

I am working on a project, where the models will be generated from EFcore with data annotations in the Model classes since we need the default data annotation for the login system from Identity.

With DataAnnotationsValidator we are displaying the validation error message.

However the default validation displayed shows the internal field name for Validation error.

Hence I have created a partial class with custom validation error message. Because we dont want to make changes to the Models generated from EF core to be manually modified every time the class is generated. 

I am able to use my custom validation from partial class. However, only default validation is performed first and then custom validation.

What are the other possible options to implement custom validation from partial classes and not actual models?


1 Reply

PK Priyanka Karthikeyan Syncfusion Team August 21, 2024 04:09 AM UTC

Hi Daphne Emmanuel,

 

We have prepared a sample demonstrating custom validation using a partial class with the Syncfusion TextBox component. The custom validation is functioning correctly, as illustrated in the video provided.

 

If there has been any misunderstanding regarding your requirements, could you please share the relevant code snippet? Additionally, if this issue occurs in any other Syncfusion component, please include that information as well, along with a video illustration to help us reproduce the issue. This will allow us to provide you with a prompt and accurate response.

For your reference, please find the documentation and forum links related to custom validation below:

 

Best regards,

Priyanka K


Attachment: Using_custom_validation_attribute_in_blazor_7527966f.zip

Loader.
Up arrow icon