﻿using System.Collections.Generic;
using Glimpse.AspNet.Extensions;
using Glimpse.AspNet.Model;
using Glimpse.Core.Extensibility;

namespace Glimpse.AspNet.SerializationConverter
{
    public class SessionModelConverter : SerializationConverter<List<SessionModel>>
    {
        public override object Convert(List<SessionModel> obj)
        {
            var result = new List<object[]> { new[] { "Key", "Value", "Type" } };
            foreach (var item in obj)
            {
                result.Add(new[] { item.Key, item.Value, item.Type });
            }

            return result;
        }
    }
}

﻿using System.Collections.Generic;
using Glimpse.AspNet.Extensions;
using Glimpse.AspNet.Model;
using Glimpse.Core.Extensibility;
using Glimpse.Core.Plugin.Assist;

namespace Glimpse.AspNet.SerializationConverter
{
    public class SessionModelConverter : SerializationConverter<List<SessionModel>>
    {
        public override object Convert(List<SessionModel> obj)
        {
            var root = new TabSection("Key", "Value", "Type");
            foreach (var item in obj)
            {
                root.AddRow().Column(item.Key).Column(item.Value).Column(item.Type);
            }

            return root.Build();
        }
    }
}

Refactor var in Session to be consistent with rest of the plugins
Refactor var in Session to be consistent with rest of the plugins
