Example #1
0
        public ItemCategoryDTO GetItemCategoryById(int itemId)
        {
            ItemCategoryDTO itemCategoryDTO = null;
            var             itemCategory    = unitOfWork.ItemRepository.GetById(itemId);

            if (itemCategory != null)
            {
                itemCategoryDTO = ItemConvertor.ConvertToItemCategoryDto(itemCategory);
            }
            return(itemCategoryDTO);
        }
Example #2
0
        public List <ItemCategoryDTO> GetAllItemCategory()
        {
            List <ItemCategoryDTO> itemCategoryList = new List <ItemCategoryDTO>();
            var itemCategories = unitOfWork.ItemRepository.GetAll();

            if (itemCategories != null)
            {
                foreach (var itemCategory in itemCategories)
                {
                    itemCategoryList.Add(ItemConvertor.ConvertToItemCategoryDto(itemCategory));
                }
            }

            return(itemCategoryList);
        }