public CategoryEntity(Category Category, params object[] args) : base(Category) { foreach (object arg in args) { if (arg is Category Parent) { ParentEntity = new CategoryEntity(Parent); } if (arg is ICollection <CategoryName> CategoryNames) { CategoryNameEntities = CategoryNames.Select(model => new CategoryNameEntity(model, model.Language)).ToList(); } if (arg is ICollection <Category> InverseParent) { InverseParentEntities = InverseParent.Select(model => new CategoryEntity(model)).ToList(); } if (arg is ICollection <ProductAttribute> ProductAttributes) { ProductAttributeEntities = ProductAttributes.Select(model => new ProductAttributeEntity(model)).ToList(); } if (arg is ICollection <Product> Products) { ProductEntities = Products.Select(model => new ProductEntity(model, model.Manufacturer)).ToList(); } if (arg is ICollection <Tax> Taxes) { TaxEntities = Taxes.Select(model => new TaxEntity(model, model.Country)).ToList(); } } }
public CountryEntity(Country Country, params object[] args) : base(Country) { foreach (object arg in args) { if (arg is ICollection <City> Cities) { CityEntities = Cities.Select(model => new CityEntity(model)).ToList(); } if (arg is ICollection <ShipmentDetail> ShipmentDetails) { ShipmentDetailEntities = ShipmentDetails.Select(model => new ShipmentDetailEntity(model, model.City, model.Customer)).ToList(); } if (arg is ICollection <Tax> Taxes) { TaxEntities = Taxes.Select(model => new TaxEntity(model, model.Category)).ToList(); } } }