how to validate one field depends on another field in asp .net core 6.0

Viewed 686

I am working a asp .net core 6.0 project. I am doing a Opayo payment API. https://developer-eu.elavon.com/docs/opayo/spec/api-reference-0#operation/createTransaction

In this API, There are some conditional required fields.

postalCode - Not required when country is IE.

state - Required when country is US.

browserJavaEnabled - Required if browserJavascriptEnabled is true.

browserColorDepth - Required if browserJavascriptEnabled is true.

credentialType object - is required when Save is true and so on..

Is there any package to add conditional Required field in asp .net core? ( for Required and NOT Required )

0 Answers
Related