//need change this method private bool CountCarInLane(DataSeed ds, int userId, ScannerFlight lane2FlightObj, string DriverLicense) { if (ds.GetDismissalCountInLane(lane2FlightObj.Flight2LaneId, DriverLicense) >= CarPerLane) { CloseLane(lane2FlightObj.LaneId); // check if scannerFlight has lane with same Id, if not create new Flight /*******************************************/ if (ScannerFlights.FirstOrDefault(p => p.LaneId == lane2FlightObj.LaneId) == null) { CreateNewFlight(ds, userId); } return(true); } return(false); }