Esempio n. 1
0
 public List <Member> GetAlcoolicStudents()
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         return(context.Participations.Include("Drinks.DrinkType").Include("Member").Where(p => p.Drinks.All(d => d.DrinkType.AlcoholContent != 0)).Select(p => p.Member).ToList());
     }
 }
Esempio n. 2
0
 public static List <DrinkType> Get()
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         return(context.DrinkTypes.ToList());
     }
 }
Esempio n. 3
0
 public List <Member> GetStudentsNoDepense()
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         return(context.Participations.Include("Drinks").Include("Member").Where(p => p.Drinks.Count == 0).Select(p => p.Member).ToList());
     }
 }
Esempio n. 4
0
 public List <Member> GetSeriousMember()
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         return(context.Members.Include("Participations").Where(m => m.Participations.Count == 0).ToList());
     }
 }
Esempio n. 5
0
 public static List <Participation> Get(int id)
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         return(context.Events.Include("Participations.Member").FirstOrDefault(e => e.Id == id).Participations.ToList());
     }
 }
Esempio n. 6
0
 public static List <Event> Get()
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         return(context.Events.Include("Association").ToList());
     }
 }
Esempio n. 7
0
 public static int AddDrink(Drink drink)
 {
     using (Db2019EventsStudentEntities context = new Db2019EventsStudentEntities())
     {
         context.DrinkTypes.Attach(drink.DrinkType);
         context.Drinks.Add(drink);
         return(context.SaveChanges());
     }
 }