public async Task <ActionResult <ItemCatogary> > PostItemCatogary([FromBody] ItemCatogaryDto itemCatogaryDto)
        {
            var map  = mapper.Map <ItemCatogary>(itemCatogaryDto);
            var post = await _itemCatogaryRepository.PostItemCatogary(map);

            return(Ok(post));
        }
        public async Task <ItemCatogary> UpdatetemCatogary(int id, ItemCatogaryDto itemCatogaryDto)
        {
            var item = await context.ItemCatogaries.Where(i => i.Id == id).SingleOrDefaultAsync();

            if (item == null)
            {
                return(null);
            }
            else
            {
                var mp = mapper.Map(itemCatogaryDto, item);
                await context.SaveChangesAsync();

                return(mp);
            }
        }
        public async Task <IActionResult> PutItemCatogary(int id, [FromBody] ItemCatogaryDto itemCatogaryDto)
        {
            if (itemCatogaryDto == null)
            {
                return(BadRequest());
            }


            var item = await _itemCatogaryRepository.UpdatetemCatogary(id, itemCatogaryDto);


            if (item == null)
            {
                return(BadRequest());
            }
            else
            {
                return(Ok(item));
            }
        }