public IActionResult Edit(ArtworkTypes type)
        {
            if (!ModelState.IsValid)
            {
                return(View("Edit", type));
            }
            artworktypeRepository.UpdateType(type);
            artworktypeRepository.Save();

            return(RedirectToAction("Index"));
        }
        public IActionResult Save(ArtworkTypes type)
        {
            if (!ModelState.IsValid)
            {
                return(View("Add", type));
            }
            artworktypeRepository.InsertType(type);
            artworktypeRepository.Save();

            return(RedirectToAction("Index"));
        }
        public IActionResult Add()
        {
            ArtworkTypes model = new ArtworkTypes();

            return(View(model));
        }
        public IActionResult GetType(int id)
        {
            ArtworkTypes model = artworktypeRepository.GetType(id);

            return(View("Edit", model));
        }
        public void DeleteType(int typeId)
        {
            ArtworkTypes type = context.ArtworkTypes.Find(typeId);

            context.ArtworkTypes.Remove(type);
        }
 public void UpdateType(ArtworkTypes type)
 {
     context.Entry(type).State = EntityState.Modified;
 }
 public void InsertType(ArtworkTypes type)
 {
     context.ArtworkTypes.Add(type);
 }