- Products -


Software


NEWS


Special



- Knowledge -


Category × Tag



- Like -

公開
作成日:2022/09/16 13:14:11
更新日:2022/09/16 13:15:54

C#でJSON可能なクラスを作成する

・プロパティの持ち方だけ注意
・以下にサンプルを示す。

※JSONにする際は、「JsonSerializer.Serializeメソッド」を使用する

サンプル



public class SampleData
{
    public SampleData(string p_氏名, string p_性別, string p_住所)
    {
        this.氏名 = p_氏名;
        this.性別 = p_性別;
        this.住所 = p_住所;
    }

    public int 氏名 { get; set; }
    public int 性別 { get; set; }
    public int 住所 { get; set; }
}


参考


https://yaspage.com/cs-json-serialize/


Category



Tag




関連記事


{{tmp.name}}

{{article.category}} {{article.title}}