예제 #1
0
        public IHttpActionResult GetProductRangeByRange(int ass = 9)
        {
            try
            {
                var items = productRangeRepository.ListByRange(ass);

                var productRanges = new List <ProductRange>();
                foreach (var item in items)
                {
                    productRanges.Add(new ProductRange()
                    {
                        ASS          = item.ProductRangeIdentifier.ASS,
                        CODE         = item.ProductRangeIdentifier.CODE,
                        OMSCHRIJVING = item.OMSCHRIJVING,
                    });
                }

                logger.Log(ErrorType.INFO, "GetProductRangeByRange(" + ass + ")", RequestContext.Principal.Identity.Name, "Total in query: " + productRanges.Count, "api/woood-assortimenten-view/list/id", startDate);

                return(Ok(productRanges));
            }
            catch (Exception e)
            {
                logger.Log(ErrorType.ERR, "GetProductRangeByRange(" + ass + ")", RequestContext.Principal.Identity.Name, e.Message, "api/woood-assortimenten-view/list/id");

                return(InternalServerError(e));
            }
        }
예제 #2
0
        public void ProductRangeList()
        {
            var rep = new ProductRangeRepository();

            var items = rep.ListByRange(1);

            items.Should().NotBeNullOrEmpty();
        }