public ActionResult Delete(int id)
        {
            try {
                var model = new PlaceType();
                model.Delete(id);

                return(RedirectToAction("Index"));
            } catch (Exception ex) {
                return(View("Error"));
            }
        }
Example #2
0
        public bool TryRemovePlaceType(PlaceType placeType)
        {
            try
            {
                DbService.ConnectDb(out _context);
                placeType.Delete();
                _context.SaveChanges();
            }
            finally
            {
                DbService.DisconnectDb(ref _context);
            }

            return(true);
        }