Beispiel #1
0
        public ActionResult Add(int?id, int?SubRedditId)
        {
            Rule item = null;

            RulesRepository repo = new RulesRepository();

            item = id == null ? new Rule() : repo.GetById(id.Value);

            EditVM model = item == null ? new EditVM() : new EditVM(item);

            if (model.Id <= 0)
            {
                model.SubRedditId = SubRedditId.Value;
            }

            return(PartialView("~/Views/Partials/Edits/_EditRules.cshtml", model));
        }