Beispiel #1
0
 public void Initilize()
 {
     for (int i = 0; i < 20; i++)
     {
         Member member = new Member();
         member.Id = i + 1;
         member.Name = null;
         if (i % 2 == 0)
         {
             member.MyAddress = new Address()
             {
                 Id = i + 1,
                 Street = "Street" + 2,
                 Door = "Door" + (i + 1)
             };
         }
         else
         {
             member.MyAddress = new Address()
             {
                 Id = i + 1,
                 Street = "Street" + 1,
                 Door = "Door" + (i + 1)
             };
         }
         member.Level = "Level" + (i + 1);
         _list.Add(member);
     }
 }
Beispiel #2
0
        private IEnumerable<Member> GetDataSource()
        {
            List<Member> list = new List<Member>();

            for (int i = 0; i < 21; i++)
            {
                Member member = new Member();
                member.Id = i + 1;
                member.Name = null;
                if (i % 2 == 0)
                {
                    member.MyAddress = new Address()
                    {
                        Id = i + 1,
                        Street = "Street" + 2,
                        Door = "Door" + 1
                    };
                }
                else
                {
                    member.MyAddress = new Address()
                    {
                        Id = i + 1,
                        Street = "Street" + 1,
                        Door = "Door" + 1
                    };
                }
                member.Level = "Level" + (i + 1);
                member.Office = "IT";
                list.Add(member);
            }
            for (int i = 21; i < 31; i++)
            {
                Member member = new Member();
                member.Id = i + 1;
                member.Name = null;

                member.MyAddress = new Address()
                {
                    Id = i + 1,
                    Street = "Street" + 3,
                    Door = "Door" + 3
                };

                member.Level = "Level" + (i + 1);
                member.Office = "Document";
                list.Add(member);
            }

            return list;
        }