private Category(CategoryDomainDto categoryDomainDto) { Name = categoryDomainDto.Name; if (categoryDomainDto.RelatedCategories != null && categoryDomainDto.RelatedCategories.Any()) { RelatedCategories = categoryDomainDto.RelatedCategories.Select(Load); } if (categoryDomainDto.SubCategory != null) { SubCategory = Load(categoryDomainDto.SubCategory); } }
public static Category Load(CategoryDomainDto categoryDomainDto) { return(new Category(categoryDomainDto)); }