You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
984 B

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<Child> Children { get; set; } = new List<Child>();
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;
}
}
}