Exemplo n.º 1
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);
        }