public IHttpActionResult Get(long id)
 {
     Category category = categoryService.GetById(id);
     var viewModel = new CategoryViewModel();
     Mapper.Map(category, viewModel);
     return Ok(viewModel);
 }
 public IHttpActionResult Put(long id, CategoryViewModel CategoryViewModel)
 {
     CategoryViewModel.Id = id;
     var category = categoryService.GetById(id);
     Mapper.Map(CategoryViewModel, category);
     categoryService.Update(category);
     return Ok(CategoryViewModel);
 }
        public IHttpActionResult Post(CategoryViewModel CategoryViewModel)
        {
            Category category = new Category();
            Mapper.Map(CategoryViewModel, category);

            category = categoryService.Add(category);
            CategoryViewModel.Id = category.Id;

            return Ok(CategoryViewModel);
        }