gpt4 book ai didi

c# - DotNetOpenAuth:模拟 ClaimsResponse

转载 作者:太空宇宙 更新时间:2023-11-03 14:30:54 25 4
gpt4 key购买 nike

我想知道如何在 DotNetOpenAuth 中模拟 ClaimseReponse 类?

这是类(删除一些属性):

[Serializable]
public sealed class ClaimsResponse : ExtensionBase,
IClientScriptExtensionResponse,
IExtensionMessage,
IMessageWithEvents,
IMessage
{
public static bool operator !=(ClaimsResponse one, ClaimsResponse other);
public static bool operator ==(ClaimsResponse one, ClaimsResponse other);

[MessagePart("email")]
public string Email { get; set; }
[MessagePart("fullname")]
public string FullName { get; set; }

public override bool Equals(object obj);
public override int GetHashCode();
}

这是我尝试过的:

ClaimsResponse MockCR = new ClaimsResponse();
MockCR.Email = "hello@sayhi.com";
MockCR.FullName = "Mister T";

我收到以下错误:“...ClaimsResponse(string)”由于其保护级别而无法访问。

亲切的问候,

泡菜

最佳答案

错误答案-评论中的正确答案

您必须通过 ClaimsRequest 对象创建它:

ClaimsRequest request = new ClaimsRequest();
ClaimsResponse response = request.CreateResponse();

关于c# - DotNetOpenAuth:模拟 ClaimsResponse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2625084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com