protected override byte[] GetItems() { using (var rep = new SlotRep()) { var conv = new ModelsForWpf.Converter <List <ModelsForWpf.Slot> >(); var lst = new List <ModelsForWpf.Slot>(); foreach (var u in rep.GetItems()) { lst.Add(Converter.ToSlot(u)); } return(conv.ObjectToByteArray(lst)); } }
static public ModelsForWpf.Parking ToParking(Parking parking) { var ret = new ModelsForWpf.Parking(parking.Id, parking.Name, parking.Adress, new List <ModelsForWpf.Slot>()); using (var slotRep = new SlotRep()) { foreach (var s in slotRep.GetItems()) { if (s.Parking_Id == ret.Id) { ret.Slots.Add(ToSlot(s, ret)); } } } return(ret); }