小编Y.Y*_*.Y.的帖子

如何在 taghelper process 方法中获取整个视图模型?

是否可以在标签帮助器 Process 方法(.NET Core MVC)中获取整个视图模型?

tag-helpers asp.net-core asp.net-core-tag-helpers

5
推荐指数
1
解决办法
1160
查看次数

如何通过 PowerShell 使用 Azure DevOps 的内部版本号更新 AssemblyInfo.cs 中的 AssemblyVersion 号?

我想使用 Azure DevOps (VSTS) 的内部版本号更新我在 AssemblyInfo.cs 中的版本号。

有谁知道我如何通过 PowerShell 做到这一点?

powershell continuous-integration continuous-deployment azure-devops azure-pipelines

5
推荐指数
1
解决办法
7300
查看次数

为什么无法在自定义中间件的构造函数中解析 DbContext?

我有自定义中间件。我尝试构造函数注入来注入我的 DbContext。但这不起作用。以下内容不起作用并给出 InvalidOperationException:无法从根提供程序解析作用域服务“MyDbContext”;

private MyDbContext _context;    
public RequestResponseMiddleware(RequestDelegate next, MyDbContext context)
{
    _next = next;
    _context = context;
} 
Run Code Online (Sandbox Code Playgroud)

但是当我在 InvokeAsync 方法中使用它作为参数时,它就可以工作。以下作品

public Task InvokeAsync(HttpContext context, MyDbContext  _context)
{

}
Run Code Online (Sandbox Code Playgroud)

有谁知道原因吗?

.net c# middleware .net-core

1
推荐指数
1
解决办法
1188
查看次数

iTextSharp复选框具有值,但未显示为已选中

我需要使用iTextSharp编辑PDF文件。我有一个单选按钮和复选框,如下所述。

我想要以下内容:如果我在单选按钮上打了一个勾号,则该复选框必须显示为选中状态。

在代码中,单选按钮具有一个值,但是当我第一次打开PDF文件时,未选中该复选框。

当我再次在单选按钮中放置一个复选标记时,它变为可见。

这是我的代码;

PdfReader pdfReader = new PdfReader(pdfTemplate);
PdfStamper pdfStamper = new PdfStamper(pdfReader, new FileStream(newFile, FileMode.OpenOrCreate)); 
AcroFields pdfFormFields = pdfStamper.AcroFields;
pdfFormFields.SetField("4a.0", "1"); // radio button
pdfFormFields.SetField("4a.1", "1"); // checkbox
pdfFormFields.SetField("4a.2", "2010"); // text box 
Run Code Online (Sandbox Code Playgroud)

c# pdf checkbox itext

0
推荐指数
1
解决办法
815
查看次数