public MarketSegment(object key, MarketSector parentSector, string name, string code) : base(key) { this.parentSector = parentSector; this.name = name; this.code = code; }
public MarketSegment(MarketSector parentSector, string name, string code) : this(null, parentSector, name, code) { }
public static MarketSector ToMarketSector(MarketSectorContract contract) { MarketSector sector = null; if (contract != null) { sector = new MarketSector(contract.Key, contract.Name); foreach (MarketSegmentContract segment in contract.Segments) { sector.Segments.Add(Converter.ToMarketSegment(segment)); } } return sector; }
public static MarketSectorContract ToMarketSectorContract(MarketSector sector) { MarketSectorContract contract = null; if (sector != null) { contract = new MarketSectorContract(); contract.Key = sector.Key; contract.Name = sector.Name; foreach (MarketSegment segment in sector.Segments) { contract.Segments.Add(Converter.ToMarketSegmentContract(segment)); } } return contract; }