public async Task <ActionResult> Delete(int id, libraryNaturguiden.PictureCategory category)
        {
            try
            {
                await PictureHandler.DeleteCategoryAsync(id);

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                ViewBag.Error = e.Message;
                return(View());
            }
        }
        public async Task <ActionResult> Edit(int id, libraryNaturguiden.PictureCategory category)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var status = await PictureHandler.UpdateCategoryAsync(category);

                    return(RedirectToAction("Index"));
                }
                catch (Exception e)
                {
                    ViewBag.Error = e.Message;
                    return(View());
                }
            }
            ViewBag.Error = "One or more fields was not filled in correctley";
            return(View(category));
        }
 public void Put(libraryNaturguiden.PictureCategory category)
 {
     pictureHandler.EditCategory(category);
 }
 public void Post(libraryNaturguiden.PictureCategory category)
 {
     pictureHandler.AddCategory(category);
 }