Beispiel #1
0
        public async Task <IActionResult> GetProductionSet(int userId, [FromQuery] PagingParams prodParams, string machType)
        {
            if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            PagedList <Production> directProductions = await _repo.GetProductionSet(userId, prodParams, machType);

            var productionForReturn = _mapper.Map <IEnumerable <ProdForReturnDto> >(directProductions);

            Response.AddPagination(directProductions.CurrentPage, directProductions.PageSize, directProductions.TotalCount, directProductions.TotalPages);

            return(Ok(productionForReturn));
        }