private async Task <bool> TryRenderContent(HttpResponse response, Content content) { var contentType = _contentTypeRepository.GetByAlias(content.ContentTypeAlias); if (contentType == null) { return(false); } var result = _viewEngine.GetView(null, $"./TenuConfig/Templates/{contentType.Alias}.cshtml", true); if (!result.Success) { return(false); } var model = GetModelForView(content, result.View); await RenderView(response, result.View, model); return(true); }
public ContentType GetByAlias(string alias) { return(_contentTypeRepository.GetByAlias(alias)); }