public void _MouthNotifications(_Notification notification) { try { _delegate(transform.name, notification.ToString()); } catch (NullReferenceException) { //Debug.Log(transform.name + ": Delegado NullReferenceException, Nadie se suscribio"); } }
// GET: Notifications public ActionResult Notifications(string userId) { _Notification notification = new _Notification(); List <Request> requests = db.Requests.Where(r => r.Author == userId && r.Status == 0).ToList(); List <int> requestIds = new List <int>(); foreach (Request r in requests) { requestIds.Add(r.Id); } notification.Messages = db.Messages.Where(m => m.Recp == userId && m.Status == 0).ToList(); notification.Offers = db.Offers.Where(o => requestIds.Contains(o.o_Parent) && o.ReadStatus == 0).ToList(); return(PartialView(notification)); }