public virtual IActionResult TopicTemplateDelete(int id) { //try to get a topic template with the specified id TopicTemplate template = _topicTemplateService.GetTopicTemplateById(id) ?? throw new ArgumentException("No template found with the specified id"); _topicTemplateService.DeleteTopicTemplate(template); return(new NullJsonResult()); }
public virtual IActionResult TopicTemplateDelete(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance)) { return(AccessDeniedView()); } //try to get a topic template with the specified id var template = _topicTemplateService.GetTopicTemplateById(id) ?? throw new ArgumentException("No template found with the specified id"); _topicTemplateService.DeleteTopicTemplate(template); return(new NullJsonResult()); }
public IActionResult TopicTemplateDelete(string id) { var template = _topicTemplateService.GetTopicTemplateById(id); if (template == null) { throw new ArgumentException("No template found with the specified id"); } if (ModelState.IsValid) { _topicTemplateService.DeleteTopicTemplate(template); return(new NullJsonResult()); } return(ErrorForKendoGridJson(ModelState)); }
public IActionResult TopicTemplateDelete(string id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageMaintenance)) { return(AccessDeniedView()); } var template = _topicTemplateService.GetTopicTemplateById(id); if (template == null) { throw new ArgumentException("No template found with the specified id"); } _topicTemplateService.DeleteTopicTemplate(template); return(new NullJsonResult()); }
/// <summary> /// Delete topic template /// </summary> /// <param name="topicTemplate">Topic template</param> public void DeleteTopicTemplate([FromBody] TopicTemplate topicTemplate) { _topicTemplateService.DeleteTopicTemplate(topicTemplate); }