1
所以我有一個類型:無效枚舉值
public enum Types
{
aaa= 1,
bbb= 2,
ccc= 4
}
public class RequestPayload
{
public int Prop1 { get; set; }
public string Prop2 { get; set; }
public Types Prop3 { get; set; }
}
並與郵差,我測試Web API。
public MyType Create([FromBody] RequestPayloadpayload)
{
return null
}
這裏是我的郵差設置:
那麼,爲什麼在我的控制對象有屬性Prop3
到6666時,我的枚舉沒有這個價值?
[在C#MVC中驗證枚舉值的可能重複。部分驗證發生 - 如何更改驗證行爲?](http://stackoverflow.com/questions/26425242/validating-enum-values-within-c-sharp-mvc-partial-validation-occurs-how-to-ch) –