j'ai une classe appelée MyMethodQuery qui contient une propriété d'entrée de ma méthode webpropriété vide ne pas causer un échec de validation malgré StringLength attribut
[DataContract()]
public class MyMethodQuery
{
[DataMember(IsRequired = true)]
[StringLength(100, MinimumLength = 10)]
public string Id{ get; set; }
}
Ma méthode Web:
public string MyMethod(MyMethodQuery MyMethodQuery)
{
return "it's ok !";
}
I vouloir lancer une exception si je laisse la propriété vide. Mais cela ne fonctionne pas malgré l'attribut StringLength
.
Je teste ma méthode avec SoapUI.