protected void AddMessages() { if (_notifications.HasNotification()) { _notifications.ListNotifications().ForEach(a => { switch (a.Key) { case ("error"): TempData["errorMessage"] = a.Value; break; case ("info"): TempData["infoMessage"] = a.Value; break; case ("success"): TempData["successMessage"] = a.Value; break; } }); } }