public CityEntity(City City, params object[] args) : base(City) { foreach (object arg in args) { if (arg is Country Country) { CountryEntity = new CountryEntity(Country); } if (arg is ICollection <ShipmentDetail> ShipmentDetails) { ShipmentDetailEntities = ShipmentDetails.Select(model => new ShipmentDetailEntity(model, model.Country, model.Customer)).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(); } } }
public CustomerEntity(Customer Customer, params object[] args) : base(Customer) { foreach (object arg in args) { if (arg is CustomerGroup CustomerGroup) { CustomerGroupEntity = new CustomerGroupEntity(CustomerGroup); } if (arg is ICollection <IssueNote> IssueNotes) { IssueNoteEntities = IssueNotes.Select(model => new IssueNoteEntity(model, model.Invoice, model.WareHouse)).ToList(); } if (arg is ICollection <Order> Orders) { OrderEntities = Orders.Select(model => new OrderEntity(model, model.ShipmentDetail)).ToList(); } if (arg is ICollection <ShipmentDetail> ShipmentDetails) { ShipmentDetailEntities = ShipmentDetails.Select(model => new ShipmentDetailEntity(model, model.City, model.Country)).ToList(); } } }