■ 컬렉션 이니셜라이저 사용하기

----------------------------------------------------------------------------------------------------

/// <summary>

/// 직원

/// </summary>

public class Employee

{

    //////////////////////////////////////////////////////////////////////////////////////////////////// Property

    ////////////////////////////////////////////////////////////////////////////////////////// Public

 

    #region ID - ID

 

    /// <summary>

    /// ID

    /// </summary>

    public string ID { get; set; }

 

    #endregion

 

    #region 성명 - Name

 

    /// <summary>

    /// 성명

    /// </summary>

    public string Name { get; set; }

 

    #endregion

}

 

...

 

List<Employee> employeeList = new List<Employee>

{

    new Employee { ID = "1", Name = "홍길동" },

    new Employee { ID = "2", Name = "김철수" },

    new Employee { ID = "3", Name = "이영희" }

};

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG