The problem is I have instances where one property is required but only based on the value of another property. I figured that I would need to write a custom attribute class for this but I cannot find any examples other the most basic that do not address my situation.
for example...
[Required]
public bool FeeAgree
{
get
{
return _feeAgree;
}
set
{
_feeAgree = value;
}
}
public decimal Fee
{
get
{
return _fee;
}
set
{
_fee = value;
}
}
in the above snippet, the FeeAgree property is only required if the Fee property value is > 0

New Topic/Question
Reply



MultiQuote




|