public ChildVm(Child child, bool getNestedListData) { this.ChildId = child.ChildId; this.FirstName = child.FirstName; this.LastName = child.LastName; this.DateOfBirth = child.DateOfBirth; this.Gender = child.Gender; CommunityActivities = new List <CommunityActivityVm>(); if (getNestedListData) { if (child.CommunityActivities != null && child.CommunityActivities.Count() > 0) { foreach (var activity in child.CommunityActivities) { CommunityActivityVm cavm = new CommunityActivityVm(activity); CommunityActivities.Add(cavm); } } } }
public ChildVm(Child child, bool getNestedListData) { this.ChildId = child.ChildId; this.FirstName = child.FirstName; this.LastName = child.LastName; this.DateOfBirth = child.DateOfBirth; this.Gender = child.Gender; CommunityActivities = new List<CommunityActivityVm>(); if (getNestedListData) { if (child.CommunityActivities != null && child.CommunityActivities.Count() > 0) { foreach (var activity in child.CommunityActivities) { CommunityActivityVm cavm = new CommunityActivityVm(activity); CommunityActivities.Add(cavm); } } } }