当我在 .Net Core 2.0 Mvc 应用程序中声明 NReco.PdfGenerator 时,出现错误。
[HttpPost]
public IActionResult Index(myModel model)
{
var html2PdfConverter = new NReco.PdfGenerator.HtmlToPdfConverter();
// etc.
}
Run Code Online (Sandbox Code Playgroud)
它抛出一个
无法从程序集“System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”加载类型“System.Web.HttpContext”
直接声明它。
有人有过 nReco 的经验吗?
Angular当我处理不在基类上的继承类型的成员并且在组件上声明了基类时,Visual Studio Code(1.17.0)在模板中生成错误。
在下面的代码中,显然maxLength不存在QuestionBase,但是我该如何处理?
[角度]标识符'maxLength'未定义。“ QuestionBase”不包含此类成员
export class QuestionBase {
id: number;
order: number;
}
export class TextQuestion extends QuestionBase {
maxLength: number
}Run Code Online (Sandbox Code Playgroud)
在组件上,问题被声明为QuestionBase,因此它可以成为任何一种问题
@Import question: QuestionBaseRun Code Online (Sandbox Code Playgroud)
现在在html模板中,我添加了maxLength属性:
<input type="text" class="form-control" id="maxLength" [(ngModel)]="question.maxLength" name="maxLength" />
Run Code Online (Sandbox Code Playgroud)