1
Given a enum
as an example:
public enum IcmsCst
{
[XmlEnum("00")] Cst00,
[XmlEnum("10")] Cst10,
[XmlEnum("20")] Cst20,
...
}
There is a form of annotation so that I could specify that a certain type of ICMS could accept only a certain type of CST
that Enum
?
For example:
public class Imposto
{
[XmlEnum(AcceptOnly = [IcmsCst.Cst00])] // como exemplo do que busco para a limitação
public ICMS Icms00 { get; set; }
}
And with that have the validation done automatically when serialize the object Imposto
in an XML?
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero