using CoviDok.Api.Objects; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace CoviDok.Data.Model { public class Parent : RoleUser { public ICollection Children { get; set; } = new List(); public void UpdateSelf(PublicParent parent) { FirstName = parent.FirstName; LastName = parent.LastName; Email = parent.Email; ImageId = parent.ImageId; } public PublicParent ToPublic() { PublicParent p= new PublicParent { FirstName = FirstName, LastName = LastName, Email = Email, ImageId = ImageId, Id = Id, Role = Api.Role.Par }; foreach (Child child in Children) { p.Children.Add(child.ToPublic()); } return p; } } }