小编raa*_*esh的帖子

C#初始化列表属性

我有以下类...我如何初始化一些值
我的问题是,我如何在Main上初始化RootObject与一些值例如

    Rootobject robj = new Rootobject();
    robj.inchistor.Add()     



    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace JsonSample3
    {

        public class Customerinfo
        {
            public string customername { get; set; }
            public string address { get; set; }
            public string postcode { get; set; }
        }

        public class Inchistory
        {

            public Customerinfo customerinfo { get; set; }
            public string r { get; set; }
            public string reference { get; set; }
            public string region { get; set; }

        }

        public class …
Run Code Online (Sandbox Code Playgroud)

c# properties list

-4
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

list ×1

properties ×1