public void Send(MessageContext messageContext) { var snapshot = new Dictionary<string, object>(); if (CurrentContexts.IsValueCreated) { if (CurrentContexts.Value.Any()) { foreach (var context in CurrentContexts.Value) { snapshot[context.Key] = JObject.Parse(JsonConvert.SerializeObject(context.Value)); } } } if (CurrentScopes.IsValueCreated) { if (CurrentScopes.Value.Any()) { var scopeEntries = new JArray(CurrentScopes.Value.Select(JObject.Parse).ToList()); snapshot[Constants.Passports.KeyScopes] = scopeEntries.OrderBy(x => (DateTimeOffset)x[Constants.PassportScope.Entry.Timestamp]) .ToList(); } } PassportStorageService.Store(messageContext, snapshot); }
private static JArray SortRanks(JArray JSA) { return new JArray { JSA.OrderBy(e => e).ToArray() }; }