public SmartParkingBoy GetBoy(BoyId boyId) { if (_boy != null) { return(_boy); } var boy = _db.Boy.Single(b => b.Id == boyId.Id); var lots = _db.BoyLot.Where(bl => bl.BoyId == boy.Id).ToList().Select(lot => new Lot(lot.LotId, _db.LotSpot.Where(ls => ls.LotId == lot.LotId).Select(ls => ls.SpotId).ToList())) .ToList(); _boy = new SmartParkingBoy(new BoyId(boy.Id), lots); return(_boy); }
public SmartParkingBoy(BoyId id, IList <Lot> parkingLots) : this((parkingLots)) { Id = id; }
protected BaseParkingBoy(IList <Lot> parkingLots) { Id = new BoyId(); Lots = parkingLots; }
public SmartParkingBoy GetBoy(BoyId boyId) { return(new SmartParkingBoy(new List <Lot> { new Lot(16) })); }