public static Expression <Func <Movement, bool> > GetQuery(MovementFilter filter) { Expression <Func <Movement, bool> > expression = order => true; if (filter.productId.HasValue) { expression = expression.And(x => x.Product.Id == filter.productId.Value); } return(expression); }
public int PathStraight(HexPoint startPoint, Vector2Int direct, int step, MovementFilter filter, out HexPoint[] path) { int pathLength = 0; path = new HexPoint[step + 1]; path[0] = startPoint; if (startPoint == null) { return(pathLength); // Error } int k = ExdMath.FindInDirectionSix(direct); if (k == -1) // Not exist this direct { return(pathLength); // Error } for (int res = 1; res <= step; res++) { HexPoint nextPoint = GetPoint(path[res - 1].positionInBoard + direct); if (nextPoint == null) { return(pathLength); } if (nextPoint.canStay == false) { return(pathLength); } if (filter.walkthroughWall == false && path[res - 1].edges[k] == 1) { return(pathLength); } path[res] = nextPoint; pathLength++; } return(pathLength); }
/// <summary> /// Method responsible for filter data. /// </summary> /// <param name="pagination"></param> /// <param name="filter"></param> /// <returns></returns> public async Task <IList <MovementDto> > FilterAsync(Pagination pagination, MovementFilter filter) => _mapper.Map <List <MovementDto> >( await _movementRepository.FilterAsync(pagination, filter));