public Task <FilterResultModel <StorageLocationViewModel> > Handle(GetStorageLocationListQuery request, CancellationToken cancellationToken)
        {
            var sortBy        = request.SortBy.Trim() != "" ? request.SortBy : "Name";
            var sortDirection = (request.SortDirection.ToUpper() == "DESCENDING") ? false : true;

            FilterResultModel <StorageLocationViewModel> result = new FilterResultModel <StorageLocationViewModel> ();
            var storage = _database.StorageLocation
                          .Select(StorageLocationViewModel.Projection)
                          .Select(DynamicQueryHelper.GenerateSelectedColumns <StorageLocationViewModel> (request.SelectedColumns))
                          .AsQueryable();

            if (request.Filter.Count() > 0)
            {
                storage = storage
                          .Where(DynamicQueryHelper
                                 .BuildWhere <StorageLocationViewModel> (request.Filter)).AsQueryable();
            }

            result.Count = storage.Count();

            var PageSize   = (request.PageSize == 0) ? result.Count : request.PageSize;
            var PageNumber = (request.PageSize == 0) ? 1 : request.PageNumber;

            result.Items = storage.OrderBy(sortBy, sortDirection)
                           .Skip(PageNumber - 1)
                           .Take(PageSize)
                           .ToList();

            return(Task.FromResult <FilterResultModel <StorageLocationViewModel> > (result));
        }
        public async Task <ActionResult <FilterResultModel <StorageLocationViewModel> > > GetAllStorageLocations([FromBody] GetStorageLocationListQuery query)
        {
            var StorageLocationList = await _Mediator.Send(query);

            return(StatusCode(200, StorageLocationList));
        }