本文整理匯總了C#中Newtonsoft.Json.JsonSerializer.Stringify方法的典型用法代碼示例。如果您正苦於以下問題:C# JsonSerializer.Stringify方法的具體用法?C# JsonSerializer.Stringify怎麽用?C# JsonSerializer.Stringify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Newtonsoft.Json.JsonSerializer
的用法示例。
在下文中一共展示了JsonSerializer.Stringify方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DefaultContractsGenerator
public DefaultContractsGenerator(JsonSerializer serializer, IPayloadDescriptorProvider payloadProvider, IMethodDescriptorProvider methodProvider, IHubDescriptorProvider hubProvider)
{
_serializer = serializer;
_payloadProvider = payloadProvider;
_methodProvider = methodProvider;
_hubProvider = hubProvider;
_generatedContracts = new Lazy<JRaw>(() => new JRaw(_serializer.Stringify(CreateContractsCache(_serializer, _payloadProvider, _methodProvider, _hubProvider))));
}
示例2: PopulateResponseState
internal static void PopulateResponseState(PersistentResponse response,
DiffSet<string> groupSet,
JsonSerializer serializer,
IProtectedData protectedData,
string connectionId)
{
bool anyChanges = groupSet.DetectChanges();
if (anyChanges)
{
// Create a protected payload of the sorted list
IEnumerable<string> groups = groupSet.GetSnapshot();
// Remove group prefixes before any thing goes over the wire
string groupsString = connectionId + ':' + serializer.Stringify(PrefixHelper.RemoveGroupPrefixes(groups)); ;
// The groups token
response.GroupsToken = protectedData.Protect(groupsString, Purposes.Groups);
}
}