1
int型のクラスのプロパティのデコレータを作成して、文字列としてシリアル化することは可能ですか?intを文字列デコレータjson newtonsoftとしてデシリアライズ
私は
public class MyClass
{
[SerializeAsString] //this is what I want
public int StreetCode { get; set; }
}
を持って、私は
var jsonRequest = JsonConvert.SerializeObject(myClass);
を呼び出すときに、これはNewtonsoftに基づくカスタムコンバータを必要と引用符
詳細情報のようなコンバータを使用します。 com/questions/22354867/how-to-make-json-net-serializer-to-call-tostring-when-serializing-a-particular –