public async Task <IActionResult> Get(Guid id) { var text = await Task.Run(() => _textFacade.GetContent(id)); if (text == null) { return(NotFound()); } return(Ok(text)); }
public async Task <IViewComponentResult> InvokeAsync(ModuleModel model) { var content = _textModuleFacade.GetContent(model.Id, _contextService.GetCurrentLanguageInfo().Id); if (content == null) { var defaultContent = "Your content here..."; await Task.Run(() => _commandSender.Send <CreateTextModule, TextModule>(new CreateTextModule { SiteId = SiteId, Id = Guid.NewGuid(), ModuleId = model.Id, Content = defaultContent })); content = defaultContent; } return(View("Default", content)); }