public class Instrument { public string SerialNumber { get; private set; } public InstrumentSpec Spec { get; set; } public Instrument(string serialNumber, InstrumentSpec spec) { SerialNumber = serialNumber; Spec = spec; } //... } public class InstrumentSpec { public Dictionary<string, object> Properties { get; set; } //... } public class Inventory { private List<Instrument> _inventory; public IEnumerable<Instrument> GetAllInstrument() { return _inventory.Select(instrument => instrument); } //... } dataGridInstruments.DataSource =
//How use linq to see all instrument with their properties like bellow table?+--------------+-------+--------+--------+------+--------------+ | SerialNumber | Color | Length | Weight | Name | CreationDate |+--------------+-------+--------+--------+------+--------------+ | 100 | red | 150 | 50 | | 1987 | | 200 | | 60 | 40 | CJ-5 | | | 300 | green | 400 | 100 | MM | 1990 |+--------------+-------+--------+--------+------+--------------+
↧
How bind list of object contain dictionary type to a datasource of a datagridview?
↧