[英]How to apply a generic JsonConverter to a property of a generic class when the property type includes the generic type?
[英]how to generic type property
是否有像枚举这样的类型可以让我将这些变量合并为一个
private string StringPropertie;
private int IntPropertie;
private float floatPropertie;
private DateTime DatetimePropertie;
private bool boolPropertie;
随之而来。
private enumtype property
您可以使用结构
public struct MyStruct
{
public string StringPropertie;
public int IntPropertie;
public float floatPropertie;
public DateTime DatetimePropertie;
public bool boolPropertie;
}
public class MyClass
{
public MyClass()
{
MyStruct property ;
//...
string str = property.StringPropertie;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.