豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit de38336

Browse files
committed
constractor
1 parent 1a94f07 commit de38336

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/NuGet.Core/NuGet.Protocol/Model/RepositoryCertificateInfo.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,45 @@ public class RepositoryCertificateInfo : IRepositoryCertificateInfo
1212
{
1313
[JsonProperty(PropertyName = JsonProperties.Fingerprints, Required = Required.Always)]
1414
[JsonPropertyName(JsonProperties.Fingerprints)]
15-
public Fingerprints Fingerprints { get; internal init; } = null!;
15+
public Fingerprints Fingerprints { get; private set; } = null!;
1616

1717
[JsonProperty(PropertyName = JsonProperties.Subject, Required = Required.Always)]
1818
[JsonPropertyName(JsonProperties.Subject)]
19-
public string Subject { get; internal init; } = null!;
19+
public string Subject { get; private set; } = null!;
2020

2121
[JsonProperty(PropertyName = JsonProperties.Issuer, Required = Required.Always)]
2222
[JsonPropertyName(JsonProperties.Issuer)]
23-
public string Issuer { get; internal init; } = null!;
23+
public string Issuer { get; private set; } = null!;
2424

2525
[JsonProperty(PropertyName = JsonProperties.NotBefore, Required = Required.Always)]
2626
[JsonPropertyName(JsonProperties.NotBefore)]
27-
public DateTimeOffset NotBefore { get; internal init; }
27+
public DateTimeOffset NotBefore { get; private set; }
2828

2929
[JsonProperty(PropertyName = JsonProperties.NotAfter, Required = Required.Always)]
3030
[JsonPropertyName(JsonProperties.NotAfter)]
31-
public DateTimeOffset NotAfter { get; internal init; }
31+
public DateTimeOffset NotAfter { get; private set; }
3232

3333
[JsonProperty(PropertyName = JsonProperties.ContentUrl, Required = Required.Always)]
3434
[JsonPropertyName(JsonProperties.ContentUrl)]
35-
public string ContentUrl { get; internal init; } = null!;
35+
public string ContentUrl { get; private set; } = null!;
36+
37+
public RepositoryCertificateInfo() { }
38+
39+
[System.Text.Json.Serialization.JsonConstructor]
40+
internal RepositoryCertificateInfo(
41+
Fingerprints fingerprints,
42+
string subject,
43+
string issuer,
44+
DateTimeOffset notBefore,
45+
DateTimeOffset notAfter,
46+
string contentUrl)
47+
{
48+
Fingerprints = fingerprints;
49+
Subject = subject;
50+
Issuer = issuer;
51+
NotBefore = notBefore;
52+
NotAfter = notAfter;
53+
ContentUrl = contentUrl;
54+
}
3655
}
3756
}

0 commit comments

Comments
 (0)