mercredi 28 mars 2018

How to validate model conditionally in web api and onion architecture?

I have two json file in which there are properties like isVisible and isReqired for two different scenario. For example in jsonfile1 DOB Has visible true and required is true and in jsonfile2 DOB is visible but not required. Now I have implemented Fluent Api validation to validate my request in api layer. My first doubt is ... is it right palce to valodate request or it is need to valodate at core layer. My second issue is that I have ckndionally load my json file but I have no ide how I validate my request condionally.

I am very new in c# and web api... can someone please suggest me how to achieve above mentioned scenario.




Aucun commentaire:

Enregistrer un commentaire