public object CreateDashboard(HttpRequestParams request)
        {
            string title = request.GetRequiredString("title");

            using (var session = Context.OpenSession())
            {
                var dashboard = new Dashboard
                {
                    Id = Guid.NewGuid(),
                    Title = title,
                    SortOrder = int.MaxValue
                };

                session.Save(dashboard);
                session.Flush();

                return dashboard.Id;
            }
        }
        private object[] GetDashboardListModel(Dashboard[] allDashboards, Guid? activeId = null)
        {
            var model = allDashboards
                    .Select(x => (object)new
                    {
                        id = x.Id,
                        title = x.Title,
                        sortOrder = x.SortOrder,
                        active = activeId == x.Id
                    })
                    .ToArray();

            return model;
        }