priya gopi

priya gopi

  • NA
  • 2
  • 2.3k

Decorator pattern

Jul 19 2012 8:29 AM
Hi,

I have a class like this,

 public class OrgChartBasicInfo
    {
        public int UserId { get; set; }
        public int ManagerUserId { get; set; }
        public string FullName { get; set; }
        public string CompanyName { get; set; }
        public string CurrentPosition { get; set; }
          
    }

Am adding these values to a collection like this

private static List<OrgChartBasicInfo> GetEmployees()
        {
            List<OrgChartBasicInfo> Employees = new List<OrgChartBasicInfo>();
            OrgChartBasicInfo ChildInfo = new OrgChartBasicInfo();
            ChildInfo.UserId = 1;
            ChildInfo.ManagerUserId = 0;
            ChildInfo.FullName = "Employee1";
            ChildInfo.CompanyName = "Abc Company";
            ChildInfo.CurrentPosition = "Reg. Director of Sales ";
            Employees.Add(ChildInfo);
            return Employees;
             }

I want to add one more property to my collection without modifying my class.

I want to add

Collapsed = 1;

in to my collection without editing my class OrgChartBasicInfo.

How can i do this?
Any help?

Thanks,
Priya



Answers (1)