Ejemplo n.º 1
0
        public IActionResult AddTag()
        {
            var model = new AddRemoveTagBaseModel
            {
                AddRemoveTagInputModel = new AddRemoveTagInputModel(),
                TagsNames = this.addonsService.GetAllTags(),
            };

            return(this.View(model));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> RemoveTag(AddRemoveTagBaseModel model)
        {
            if (this.ModelState.IsValid)
            {
                var tuple = await this.addonsService.RemoveTag(model.AddRemoveTagInputModel.Name);

                this.TempData[tuple.Item1] = tuple.Item2;
            }
            else
            {
                this.TempData["Error"] = ErrorMessages.InvalidInputModel;
                return(this.RedirectToAction("AddTag", "BlogAddons", model));
            }

            return(this.RedirectToAction("AddTag", "BlogAddons"));
        }