public IEnumerable<User> getUser()
 {
     using (var context = new ProiectContext())
     {
         var query = (from n in context.Users select n).ToList<User>();
         return query;
     }
 }
 public IEnumerable<Intrebari> getIntr()
 {
     using (var context = new ProiectContext())
     {
         var query = (from n in context.Intrebaris
                      select n).ToList<Intrebari>();
         return query;
     }
 }
 public IEnumerable<Materii> getMat()
 {
     using (var context = new ProiectContext())
     {
         var query = (from n in context.Materiis
                      select n).ToList<Materii>();
         return query;
     }
 }
 public IEnumerable<Raspunsuri> getRasp(int id_intr)
 {
     using (var context = new ProiectContext())
     {
         var query = (from n in context.Raspunsuris
                      where n.ID_intrebare == id_intr
                      select n).ToList<Raspunsuri>();
         return query;
     }
 }
 public IEnumerable<User> getProf()
 {
     using (var context = new ProiectContext())
     {
         var query = (from n in context.Users
                      where n.ID_rol == 2
                      select n).ToList<User>();
         return query;
     }
 }
        public int getIDMaterie(string nume_materie)
        {
            using (var context = new ProiectContext())
            {
                Int32 query = (from n in context.Materiis
                               where n.materie == nume_materie
                               select n.ID).FirstOrDefault();
                return query;

            }
        }
 public int getIDIntrebare(string intrebare)
 {
     using (var context = new ProiectContext())
     {
         Int32 query = (from n in context.Intrebaris
                        where n.Intrebare == intrebare
                        select n.ID).FirstOrDefault();
         return query;
     }
 }