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);
        }
Exemple #2
0
 public SmartParkingBoy(BoyId id, IList <Lot> parkingLots) : this((parkingLots))
 {
     Id = id;
 }
Exemple #3
0
 protected BaseParkingBoy(IList <Lot> parkingLots)
 {
     Id   = new BoyId();
     Lots = parkingLots;
 }
Exemple #4
0
 public SmartParkingBoy GetBoy(BoyId boyId)
 {
     return(new SmartParkingBoy(new List <Lot> {
         new Lot(16)
     }));
 }