コード例 #1
0
        public ActionResult Delete(int id, RoomTypeViewModel model)
        {
            try
            {
                bool result = _roomTypeService.RemoveRoomType(id);

                if (result)
                {
                    return(RedirectToAction(nameof(Index)));
                }
                throw new Exception();
            }
            catch
            {
                ModelState.AddModelError(string.Empty, "Ooops! Something went wrong!");
                return(View());
            }
        }