private Notification GetPECNotRead() { try { Notification model = new Notification(); CommonUtil cutil = new CommonUtil(); NHibernatePECMailFinder _pecMailFinder = new NHibernatePECMailFinder(); _pecMailFinder.Actives = true; _pecMailFinder.Direction = (short)PECMailDirection.Ingoing; _pecMailFinder.NotRead = true; _pecMailFinder.CheckSecurityRight = true; cutil.ApplyPecMailFinderSecurity(ref _pecMailFinder); model.NotificationName = NotificationType.PECDaLeggere.ToString(); model.NotificationCount = _pecMailFinder.Count(); return(model); } catch (Exception ex) { FileLogger.Error(LogName.WebAPIClientLog, ex.Message, ex); throw; } }