[英]C# JSON convert enums to/from strings
There is a question about generically converting enums to/from strings . 关于将枚举与字符串进行通用转换存在一个问题。 This questions is a little different. 这个问题有点不同。
Is there a way in an ASP.NET Web API 2 app to define the controller API for a call where it will receive/return JSON where the property is a string in the JSON, but it is declared as an enum? ASP.NET Web API 2应用程序中是否可以为调用定义控制器API,该调用将接收/返回JSON,而该属性是JSON中的字符串,但被声明为枚举?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.