Exemple #1
0
        public ItemCategoryClientDTO GetItemCategoryById(int categoryId)
        {
            var itemCategory = itemCategoriesRepository.GetById(categoryId);
            ItemCategoryClientDTO _itemCategory = new ItemCategoryClientDTO()
            {
                Id          = itemCategory.Id,
                Name        = itemCategory.Name,
                IsAvailable = (bool)itemCategoriesAvailablityRepository.GetAll().Where(i => i.ItemCategoryId.Equals(categoryId)).Select(p => p.IsAvailable).First(),
                Discount    = itemCategory.Discount,
                Description = itemCategory.Description,
                ImageUrl    = itemCategory.ImageUrl,
            };

            return(_itemCategory);
        }
        public ItemCategory GetId(int id)
        {
            var idlist = _ItemCategoryRepository.GetById(id);

            return(idlist);
        }