public override IEnumerable <IBarCode> GetAllBarCodes() { _table.InitializeDatabase(); var barCodes = _table.SelectAll().ToArray(); return(barCodes.Select(objects => ObjectToIBarCodeConvertor.Convert(objects, BarCodeFactory, _transactionStorage)).ToList()); }
public override IBarCode CreateBarCode(IBarCode barCode) { _table.InitializeDatabase(); if (barCode.Id == 0) { barCode.Id = _table.AddData(ObjectToIBarCodeConvertor.ConvertToKeyValuePair(barCode)); } else { _table.AddData(ObjectToIBarCodeConvertor.ConvertToKeyValuePairWithId(barCode)); } return(barCode); }
public override void UpdateBarCode(IBarCode barCode) { _table.InitializeDatabase(); _table.UpdateData(ObjectToIBarCodeConvertor.ConvertToKeyValuePair(barCode), barCode.Id); }