Exemplo n.º 1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
Exemplo n.º 2
0
        public static int UserNotifications(IPrincipal User, bool isAuthenticated)
        {
            if (!User.IsInRole("Administrator"))
            {
                if (!User.IsInRole("Restaurant"))
                {
                    var db = new UPCLunchContext();

                    int nroNotificaciones = (from obj in db.Notifications
                                             where obj.Email == User.Identity.Name && obj.Seen == false
                                             select obj).Count();
                    db.Dispose();
                    return(nroNotificaciones);
                }
            }
            return(0);
        }