public ActionResult Dashboard(string id)
 {
     var uow = Helper.GetUnitOfWorkByCurrentUser();
     var model = new DashboardModel();
     model.Dashboard = uow.Dashboards.Get(f => f.FriendlyUrl == id).FirstOrDefault();
     return View("Dashboard", model);
 }
        public JsonResult Create(DashboardModel model)
        {
            var uow = Helper.GetUnitOfWorkByCurrentUser();
            var name = model.Name.Trim();
            var dashboard = new Dashboard()
            {
                Name = name,
                FriendlyUrl = Helper.CreateFriendlyURL(name)
            };

            var dashboardExists = uow.Dashboards.Get(f => f.FriendlyUrl == dashboard.FriendlyUrl).FirstOrDefault();
            if (dashboardExists != null)
                throw new Exception("Já existe um dashboard cadastrado com esse mesmo nome, tente outro.");

            uow.Dashboards.Insert(dashboard);

            return Json(new { Success = true });
        }